Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > WebForm varaibles

Reply
Thread Tools

WebForm varaibles

 
 
Saman Priyantha
Guest
Posts: n/a
 
      02-10-2004
I add a button to my webForm in aspx and I use c# language using Visual
Studio. Then I use Server.Transfer method to call another web page in the
button_click method. When I assign a value for a hidden field in a
button_click mehod , Calling web Page doesn't include the value of hidden
field. Please tell me how I solve this problem.
code of first web page button_click method
private void Button1_Click(object sender, System.EventArgs e)

{

CheckBox tcTo;

CheckBox tcCc;

CheckBox tcBcc;

foreach(DataGridItem DemoGridItem in DataGrid1.Items)

{

tcTo =(CheckBox)DemoGridItem.Cells[0].Controls[1];

tcCc =(CheckBox)DemoGridItem.Cells[1].Controls[1];

tcBcc =(CheckBox)DemoGridItem.Cells[2].Controls[1];


if(tcTo.Checked==true)

{

tcstrGetCheckTo+=(string)DemoGridItem.Cells[3].Text+";";


}

if(tcCc.Checked==true)

{

tcstrGetCheckCc+=(string)DemoGridItem.Cells[3].Text+";";


}

if(tcBcc.Checked==true)

{

tcstrGetCheckBcc+=(string)DemoGridItem.Cells[3].Text+";";


}


}

HidTo.Value=tcstrGetCheckTo;

HidCc.Value=tcstrGetCheckCc;

HidBcc.Value=tcstrGetCheckBcc;


Server.Transfer("WebForm1.aspx");

}

http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
CMA
Guest
Posts: n/a
 
      02-10-2004
hi dear, )

if u need to refer any value from one page to another page, u can use
"Session" variables. pls check on Session variables.

you can use Response.Redirect("URL"); to navigate to a new page too.

regards,
CMA.


"Saman Priyantha" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I add a button to my webForm in aspx and I use c# language using Visual
> Studio. Then I use Server.Transfer method to call another web page in the
> button_click method. When I assign a value for a hidden field in a
> button_click mehod , Calling web Page doesn't include the value of hidden
> field. Please tell me how I solve this problem.
> code of first web page button_click method
> private void Button1_Click(object sender, System.EventArgs e)
>
> {
>
> CheckBox tcTo;
>
> CheckBox tcCc;
>
> CheckBox tcBcc;
>
> foreach(DataGridItem DemoGridItem in DataGrid1.Items)
>
> {
>
> tcTo =(CheckBox)DemoGridItem.Cells[0].Controls[1];
>
> tcCc =(CheckBox)DemoGridItem.Cells[1].Controls[1];
>
> tcBcc =(CheckBox)DemoGridItem.Cells[2].Controls[1];
>
>
> if(tcTo.Checked==true)
>
> {
>
> tcstrGetCheckTo+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
> if(tcCc.Checked==true)
>
> {
>
> tcstrGetCheckCc+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
> if(tcBcc.Checked==true)
>
> {
>
> tcstrGetCheckBcc+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
>
> }
>
> HidTo.Value=tcstrGetCheckTo;
>
> HidCc.Value=tcstrGetCheckCc;
>
> HidBcc.Value=tcstrGetCheckBcc;
>
>
> Server.Transfer("WebForm1.aspx");
>
> }
>
> (E-Mail Removed)
>
>



 
Reply With Quote
 
 
 
 
Saman Priyantha
Guest
Posts: n/a
 
      02-10-2004




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Howmay varaibles can be declared as register? RANNA C Programming 5 11-10-2008 10:46 PM
session varaibles with asp.net urgent help =?Utf-8?B?YW1qYWQ=?= ASP .Net 6 07-07-2006 01:46 PM
Re: Session varaibles are lost when an error occurs So ASP .Net 0 05-13-2005 12:52 PM
Session varaibles are lost when an error occurs So ASP .Net 1 05-04-2005 11:19 AM
Initialization Sequence of Global Varaibles Cheng Mo C++ 4 12-02-2004 06:12 AM



Advertisments