Click here to Skip to main content
15,892,005 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to send parameters in sql statement using data adapter. Pin
Sophia Rekhi11-Apr-07 22:55
Sophia Rekhi11-Apr-07 22:55 
AnswerRe: how to send parameters in sql statement using data adapter. Pin
Mazdak11-Apr-07 22:50
Mazdak11-Apr-07 22:50 
QuestionRedirect and transfer Pin
yaminilatha11-Apr-07 22:29
yaminilatha11-Apr-07 22:29 
AnswerRe: Redirect and transfer Pin
Sophia Rekhi11-Apr-07 22:41
Sophia Rekhi11-Apr-07 22:41 
GeneralRe: Redirect and transfer Pin
yaminilatha13-Apr-07 1:16
yaminilatha13-Apr-07 1:16 
QuestionControls in other page Pin
yaminilatha11-Apr-07 22:24
yaminilatha11-Apr-07 22:24 
AnswerRe: Controls in other page Pin
gauthee11-Apr-07 22:29
gauthee11-Apr-07 22:29 
AnswerRe: Controls in other page Pin
Chetan Ranpariya12-Apr-07 21:40
Chetan Ranpariya12-Apr-07 21:40 
Hi Yamini,

It is not possible to access the controls of one page in to other page.
but you can have the values of the controls of one page into other page by using various state management techiniques like SessionState and QueryString.

If you want get the vaules of all the controls from the first page into the second page you can do it by the following way.
The following is the code in my Default.aspx.

<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="T">Tea</asp:ListItem>
<asp:ListItem Value="C">Coffee</asp:ListItem>
<asp:ListItem Value="W">Wheat</asp:ListItem>
<asp:ListItem Value="CH">Chilli</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

The following is the Code written in Button1_Click

Server.Transfer("MyPage.aspx", true);

------------------------------------------------------------------------

Now in the Load event of MyPage.aspx I can get the value of the drowdown list of Default.aspx page as following.

protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Request.Form["DropDownList1"].ToString());
}

This way you can get value of any of the contrls of the previous form.

----------------------------------------------------------------------
Caution : to make this thing working you need to put EnableViewStateMac="false" in the @Page directive of first aspx page whose control values you want to access.

I hope this will solve your issue.


Thanks and Regards,
Chetan Ranpariya
GeneralRe: Controls in other page Pin
yaminilatha13-Apr-07 1:32
yaminilatha13-Apr-07 1:32 
GeneralRe: Controls in other page Pin
Chetan Ranpariya13-Apr-07 1:39
Chetan Ranpariya13-Apr-07 1:39 
QuestionSetting master page values Pin
Brendan Vogt11-Apr-07 22:05
Brendan Vogt11-Apr-07 22:05 
Questionhow to set the width of a label webcontrol at runtime Pin
MissionSuccess11-Apr-07 21:43
MissionSuccess11-Apr-07 21:43 
AnswerRe: how to set the width of a label webcontrol at runtime [modified] Pin
thomasa12-Apr-07 0:04
thomasa12-Apr-07 0:04 
QuestionNeed help in DropDownList in Grid View Pin
Jia Fang11-Apr-07 21:30
Jia Fang11-Apr-07 21:30 
AnswerRe: Need help in DropDownList in Grid View Pin
gauthee11-Apr-07 22:40
gauthee11-Apr-07 22:40 
AnswerRe: Need help in DropDownList in Grid View Pin
thomasa11-Apr-07 22:49
thomasa11-Apr-07 22:49 
QuestionTree view remove child node Pin
J Liang11-Apr-07 20:39
J Liang11-Apr-07 20:39 
AnswerRe: Tree view remove child node Pin
Naveed Kamboh11-Apr-07 22:37
Naveed Kamboh11-Apr-07 22:37 
GeneralRe: Tree view remove child node Pin
J Liang11-Apr-07 22:50
J Liang11-Apr-07 22:50 
QuestionScreenscraping Real Time Stock Quotes ?? Pin
vivek_r11-Apr-07 20:16
vivek_r11-Apr-07 20:16 
AnswerRe: Screenscraping Real Time Stock Quotes ?? Pin
Paddy Boyd11-Apr-07 23:07
Paddy Boyd11-Apr-07 23:07 
QuestionHelp Me soon Pin
Mkanchha11-Apr-07 19:53
Mkanchha11-Apr-07 19:53 
AnswerRe: Help Me soon Pin
Sophia Rekhi11-Apr-07 22:47
Sophia Rekhi11-Apr-07 22:47 
QuestionImport from excell to SQL 2005 Pin
samerh11-Apr-07 19:53
samerh11-Apr-07 19:53 
AnswerRe: Import from excell to SQL 2005 Pin
Mayank Parmar12-Apr-07 0:26
professionalMayank Parmar12-Apr-07 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.