How to Retrieve Value from Aspx in Usercontrol

Posted by Jayakumars under Regular Expressions on 6/11/2011 | Points: 10 | Views : 12004 | Status : [Member] [MVP] | Replies : 11
hi

I have 2 pages 1.aspx,2.usercontrol ascx file usercontrol purpose using gridview
here i need how retrieve gridview values from aspx file in usercontrol how will do
this and pass value from usercontrol to aspx page how will do this.

Mark as Answer if its helpful to you


Responses

Posted by: Chvrsri on: 6/11/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Find my article on this topic !!!

http://www.dotnetfunda.com/articles/article1094-accessing-a-method-of-aspx-page-into-a-user-control-.aspx

Hope this helps !

Thanks,
Radha Srikanth

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 6/12/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Jayakumar,

Refer @Chvrsri link...Its really helpful to you.
For more info about usercontrol refer this...http://msdn.microsoft.com/en-us/library/ms972975.aspx

Thanks,
T.Saravanan

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 6/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Chvrsri

this url not working
http://www.dotnetfunda.com/articles/article1094-accessing-a-method-of-aspx-page-into-a-user-control-.aspx
didnot include _Default class in usercontrol.

Check this attachments.


 Download source file

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 6/14/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi Jayakumars ,

In the above mentioned article i have clearly mentioned in the Step @ 3rd point as ,

" 3) Above mentioned code describes this would casts the Page property to the desired type so that we can access that method. The label text is assigned with the class name of parent page that is (_Default) and message is the mthod which we declared in the .aspx page "

Thanks,
Radha Srikanth

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 6/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Chvrsri

above i am attach error file can you post your code zip format that may be helpful for me plz.

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nithadeepak on: 6/14/2011 [Member] Bronze | Points: 25

Up
0
Down
Go through all the posts in below link.
http://www.dotnetfunda.com/forums/thread4440-how-to-use-ascx-user-control.aspx

Nitha Deepak

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 6/14/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Here i am attaching the sample which i have used , but this varies slightly to the example which i have used in the article hope this helps !!!
 Download source file

Thanks,
Radha Srikanth

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 6/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

srikanth your code not worling this zip file did not fire pageload event default.aspx file

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 6/14/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
In the mean while go through these links
http://www.dotnetfunda.com/articles/article97.aspx
http://www.dotnetfunda.com/articles/article16.aspx

I will check my code and update this thread again. Sorry for the delay as i was extremely busy with my work

Thanks,
Radha Srikanth

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 6/14/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi,

This is the Updated code which is working absolutely fine use this for accessing a method of .aspx into a user control.

Sorry for the delay.Also added the solution file.

Hope this helps.
 Download source file

Thanks,
Radha Srikanth

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response