Web user controls

Results 1 to 3 of 3

Thread: Web user controls

  1. #1
    Join Date
    Dec 1969

    Default Web user controls

    I'm trying to make an aspx page where a user presses a button and the url associated with the button is placed within a table in the center of the page...anyone have some info on the code that would allow this?

  2. #2
    Join Date
    Dec 1969

    Default RE: Web user controls

    depends if the url is part of your site or not.<BR><BR>if it is not part of your site, consider using frames or some such trick because that is not really a server side issue...unless you wanted to go using screen scraping or some other technique which i really dont think applied to what you are talking about...<BR><BR>if the url you want to include is in your site, then make that url an ascx file. you then call all the ascx files which might be used in the section of your code where they would appear. each user control has an id. you use the id to specify whether the control is to be either visible or not visible depending on which button is clicked.<BR><BR>for example:<BR><BR>Sub Handle_Click(Sender As Object, e As EventArgs)<BR> MyControl1.Visible = True<BR> MyControl2.Visible = False<BR>End Sub<BR><BR>if the control is marked visible, it will be rendered. if it is marked "not visible" it will not be rendered. but you can control manipulate ascx files in this way from an aspx page. you cannot manipulate other aspx files from an aspx file using this method<BR><BR>if this helps, please help me. my open problem is right below yours<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Yep....He's right Doug.....that's one wa

    Good idea. Depending on the WUC you want to load doug...you can also use something Kevin Messiab dug up for me:<BR><BR>[code behind]<BR><BR>public class CodeBehindPage : Page<BR>{<BR><BR>public UserControl Login;<BR>public UserControl Header;<BR>public UserControl RandomUserControl;<BR><BR>void Page_Load()<BR>{<BR><BR>/// load the .ascx files into the UserControl object<BR><BR>Login = LoadControl("some/path/login.ascx");<BR>Header = LoadControl("some/path/header.ascx");<BR>RandomUserControl = LoadControl("/blah/blah/rnd.ascx");<BR><BR>/// Add the UserControl to the page<BR><BR>Focus_Pane.Controls.Add(Login);<BR>Foc us_Pane.Controls.Add(Header);<BR>Focus_Pane.Contro ls.Add(RandomUserControl);<BR><BR>}<BR>}<BR><BR><B R>which is all in a focus pane which holds the WUC&#039;s. <BR><BR>I&#039;ll explain it all to you tomorrow (FRI). <BR>

Posting Permissions

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