Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This may sound rather stupid but i must be missing something.When i create a web control and drag onto a web form.How do i access it from my form code. It does not create instance of the control.I have used the findcontrol method .But it seems like a long way around .Is there no other way.

 

What i want to do is use it like any normal web control ex dropdownlist.

Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.
Posted

The following is what i did.Basicly the same so there is no other way.

 

 

Protected myWEBcontrol1 As WebUserControl1

 

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

myWEBcontrol1 = CType(Me.FindControl("MYWEBCONTROL1"), WebUserControl1)

 

 

InitializeComponent()

 

 

 

End Sub

 

#End Region

 

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

 

Me.myWEBcontrol1.Button1.Text = "DD"

 

 

 

End Sub

Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.
Posted

I will try that.

THanks.

Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...