Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

faiqshah

@faiqshah
About
Posts
6
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Web Custom Control Problem
    F faiqshah

    Hi All I have problem regarding WebCustom Control I am trying to develop a generic WebCustomControl for searching purpose. What i am trying to do is to pass UI Controls such as labels textboxes etc from the hosting page to the webcustom control. I have a method in WebCustomControl Class that add these control to the Control Collection of the WebCustomControl. The logic of the method is public void AddControls(Controls[] UIControls) { foreach (Control control in UIControls) { this.Controls.Add(control ); } } The Method is called from the Hosting Page as TextBox txt1 = new TextBox(); txt1.ID = "txtname"; Control[] c ={ txt1}; search.AddControls(c); I creat a control array and store my textbox in it i then pass the array to the method of webcustom control. Now the problem is that when render method of the control is called the control collection of webcutomcontrol lost its value. the logic of RenderContents is as protected override void RenderContents(HtmlTextWriter output) { foreach (Control control in UIControls) { control .RenderControl(output); } } :doh:This is fairly simple but i don't know where the problem is Any assistance will be appreciated Regards Faiq shah Afridi

    ASP.NET design hosting algorithms data-structures help

  • generating serial number in gridview
    F faiqshah

    You should have a column say S.No in gridview as Best Luck Faiq Afridi

    ASP.NET tutorial

  • Problem in Getting the value of as server side hidden control on client side.
    F faiqshah

    there may be two possible problem If the HiddenControl is part of some usercontrol i mean am ascx then you need to get it ClientID.This is because ASP.NET change the ID of control that have a runat="server" . you can see the ID of your control by viewing the Source of the page.check that the ID of your Hidden control in page source is "ChkNewEdit" or some thing like "ctl_100_serer_xxx" . 2 you r calling the function on page load. but at that time the control that you r accessing in the function have not been created yet. you should register your script tag at the end as --- --- var chk=document.forms[0].getElementById('ChkNewEdit').value; if (chk="new") document.forms[0].getElementById('txtName').focus(); else document.forms[0].getElementById('txtContactPerson').focus(); instead of writing function just paste your function source code in script tag don't call the function at page load . it will call automatically when the page is rendered. :)try this it will work best luck Faiq Afridi

    ASP.NET javascript sysadmin help tutorial

  • How to call a method in another .aspx file
    F faiqshah

    mubashir is right You need to Crerat a separate class inside the class create a satic Method e.g Public static void MyFunction() { //some code } the function can be then call in many pages Note: The class must be of public scope

    ASP.NET help tutorial question

  • VIew State in CustomControl
    F faiqshah

    Hi All I have a problem with maintaining view state in WebCustomControl. The problem is that i want to create a generic search control. All controls that is used in search criteria is passed from hosting page e.g TextBox txt1 = new TextBox(); TextBox txt2 = new TextBox(); TextBox txt3 = new TextBox(); Control[] c ={ txttest, txt1, txt2, txt3 }; SearchControl.WebCustomControl1.AddControls(c); Where Add control is Satic method in webcustom control its code is as public static void AddControls(Control[] Controls) { UIControls = Controls; } where UIControls is static Control array defined in Custom control I then Render the control as protected override void RenderContents(HtmlTextWriter output) { output.Write(""); for (int i = 0; i < UIControls.Length; i++) { output.Write(" "); output.Write(" "); output.Write(" "); } output.Write(" "); output.Write(" "); output.Write(" "); output.Write("

    "); UIControls[i].RenderControl(output); output.Write("

    "); output.Write(""); output.Write(""); output.Write("

    "); } Now the problem is that when i access any of the control, its value is lost! Any one that can help me plz regards

    ASP.NET help hosting data-structures

  • Datagrid with session problem
    F faiqshah

    If the button is inside the datagrid then it is fairly easy. what you have to do is to hook the ItemCommand or RowCommand (in case you have Gridview). The following code may help you the CommandArgument property is inialized with the Id filed value in your table. you may then right the following code in RowCommand event protected void gw_RowCommand(object sender, GridViewCommandEventArgs e) { int ID = Convert.ToInt32(e.CommandArgument.ToString()); Session["ID"]=ID.ToString(); Response.redirect("http:detail.aspx"); } After the page is redirected to detail page there you should retrieve the ID value from the session as Integer Code=Convert.ToInt32(Session["ID"].ToString()); you can then use the Code to query your database and retrieve the datail best luck

    ASP.NET help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups