CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    [RESOLVED] How to ReFresh a user Control

    i have a userControl and am using it in a aspx page, now i have expose the Following Method that reside in the usercontrol like this

    Code:
      public void load_Again()
        {
            string clientscript = "";
    
            // make available to all subcontrols a variable with the client ID of the textbox in which to store the selected activity IDs
            clientscript = "var txtbxActvClientID = '" + txtbxActvs.ClientID.ToString() + "'; ";
            // assign the current list of selected activities to the list for JavaScript here
            //clientscript += "var ActivityList = String(\"" + txtbxActvs.Text + "\"); ";  
            ClientScriptManager cs = Page.ClientScript;
            cs.RegisterClientScriptBlock(this.GetType(), "txtbxlookupid", clientscript, true);
            HighlightSelectedActvs();
        }
    and am calling it on my aspx page like this
    Code:
    ActivityCtrl1.load_Again();
    i have Copied the code you see in the method load_Again() from the page load event of the Control. I want refresh or load the page again after i click a button in my aspx page.

    Thank you
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

  2. #2
    Join Date
    Oct 2008
    Posts
    47

    Re: How to ReFresh a user Control

    Wrap this around your control...

    <a href="#" onclick="location.reload(true)">CONTROL HERE</a>

    Its a JavaScript call that will provide the functionality I think you are looking for

    Hope this helps,

    Larry Darrah
    MS Architect Evangelist

  3. #3
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Resolved Re: How to ReFresh a user Control

    Thank you very much, this Did the Work

    Thanks
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

  4. #4
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: [RESOLVED] How to ReFresh a user Control

    Thanks buddy, but i still have a Problem.

    How do i use the Javascript you gave me in ASp.net. i tried io implement it like this on a Button Click event

    Code:
    Response.Write("<script><a href='SubjectStaff.aspx' onclick='location.reload(true)'>'ActivityCtrl.ascx'</a></script>");
    Thanks
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured