473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how can i send parameter with writing code

hi
i am milad and i have started learning asp.net c# for 2 months
how can i send parameter to a page with code
i did this work with html by writing the destination address in action
thanks

Nov 5 '06 #1
7 1408
Put the object / variable / struct etc into a session variable. This
is an object maintained in the background across all pages. You must
cast it back when retrieving it.
example showing what to to if putting a string into session variable.
putting into:
string s = "hello";
Session["mySession"] = s;
extracting:
string retrieved_s = (string) Session["mySession"];
if a cast doesnt work to convert it back, you may need to try the
Convert.ToString() method or whichever as appropriate for type

mi********@gmail.com wrote:
hi
i am milad and i have started learning asp.net c# for 2 months
how can i send parameter to a page with code
i did this work with html by writing the destination address in action
thanks
Nov 5 '06 #2
hi
thanks my dear friend
i am going to test your code
i am amateur in this case :)
my work field is in flash
i can do every work you want
thanks alot

Nov 6 '06 #3
no worries mate, let me know how it goes!
mi********@gmail.com wrote:
hi
thanks my dear friend
i am going to test your code
i am amateur in this case :)
my work field is in flash
i can do every work you want
thanks alot
Nov 6 '06 #4
i tested your code
this syntax didn't work in asp.net 2 with c# language
i think it works in asp
should i type any namespace ?
ofcourse i want to create a page for login to a another page
in first page username and password are checked if were correct go to
second page
but i don't want to a user type the name of second page and view the
page
i want to send a form parameter from first page to second page that
only let to view page if
that variable be true
i hope you understand :)
i amnot american and i can't speak and type in american well
thanks

Nov 6 '06 #5
dont worry, Im not American either. English.

Ok, so you want to send a boolean accross several pages.

so:

//on login_page.aspx
bool successfulloging = false;

//then write whatever code to test login details and set this boolean
appropriately.
//then put into session variable

Session[s_successfullogin] = successfullogin;

//on the other page you need to take the boolean out of the session
variable

boolean successfullogin = (bool) Session["s_successfullogin"];

if(successfullogin != true)
{
Response.Redirect("login_page.aspx");
}
you can use forms authentication in .net 2.0 also. This is very
simple.
mi********@gmail.com wrote:
i tested your code
this syntax didn't work in asp.net 2 with c# language
i think it works in asp
should i type any namespace ?
ofcourse i want to create a page for login to a another page
in first page username and password are checked if were correct go to
second page
but i don't want to a user type the name of second page and view the
page
i want to send a form parameter from first page to second page that
only let to view page if
that variable be true
i hope you understand :)
i amnot american and i can't speak and type in american well
thanks
Nov 8 '06 #6
thanks
i understand your help
thanks alot
can i request you that give me a link of an e-book about asp.net
c-sharp
or asp.net vb
only my english friend
what can i do for you about this good helps
thanks

Nov 9 '06 #7
hey,

Dont worry bout it, glad to be able to help. Unfortunately, I do not
use ebooks in this case. At work we have several c# books and the wrox
asp.net 2.0 books. Sorry cant help here.

good Luck.

Paul

mi********@gmail.com wrote:
thanks
i understand your help
thanks alot
can i request you that give me a link of an e-book about asp.net
c-sharp
or asp.net vb
only my english friend
what can i do for you about this good helps
thanks
Nov 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Philippe Bertrand | last post by:
Using C#, I want to send a byte array to an unmanaged function with the minimum amount of copies. The array is input only and won't be modified (its copied on the unmanaged side). I'm currently...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
2
by: louise raisbeck | last post by:
hi, if i cause the onclick event to fire with an ImageButton I can send CommandArgument which I find really handy to grab some relevant value (which means i can reuse code for many buttons and...
6
by: Thomas | last post by:
hello, i am searching for a while to use net send in vb.net without using the commandline net send... is there an api, with an example... i know that there is the possib. to send such messages...
0
by: Alexiel | last post by:
Hi, i have a problem, I have a Java Client and i call my webservice on ..NET. This run perfectly just except when i send parameters don't work fine. I send my code : This is my java...
1
by: Tony Johansson | last post by:
Hello! Class CharChecker has a field that is called TestChar that is of type event CharEventHandler. I know that if I change in method foo so I have tester.TestChar +=new...
11
by: iwasinnihon | last post by:
I writing a program that will send both a text/html document as well as jpegs using winsock. My code works find for the text, but will not work with jpegs. My code is below. What am I missing? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.