|
|
Check this example in order to transfer information from page 1 to page 2
This Example transfer the text and date string from page 1 and capture the information on page 2
page1.aspx
Five Controls
TextBox1
Calendar1
Button1
Button2
Label1
codeBehind for page1.aspx
<br />
public partial class page1 : System.Web.UI.Page<br />
{<br />
string text1 = "";<br />
string text2 = "";<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
text1 = TextBox1.Text;<br />
text2 = Calendar1.SelectedDate.ToShortDateString();<br />
Label1.Text = text1 + text2;<br />
}<br />
protected void Button2_Click(object sender, EventArgs e)<br />
{<br />
text1 = TextBox1.Text;<br />
text2 = Calendar1.SelectedDate.ToShortDateString();<br />
Response.Redirect("page2.aspx?message1="+text1+"&message2="+text2 ,true);<br />
}<br />
}<br />
Page2.aspx
Two Controls
Label1
Button1
code behind for page2.aspx
<br />
public partial class page2 : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
string ms1 = Request.QueryString["message1"].ToString();<br />
string ms2 = Request.QueryString["message2"].ToString();<br />
<br />
Label1.Text = ms1 + ms2;<br />
}<br />
}<br />
keep Learning and you never will be out of date...
|
|
|
|
|
sir/madam
sir i am fresher.i am working on job portal.how we pass information fron one page to anther page and save in database.like jobseeker form.please send me the coding of this portion
Thanks
|
|
|
|
|
|
Dim con As SqlConnection = New SqlConnection("data source=localhost;database=jwdbc;integrated security=sspi")
con.Open()
Dim cmd As SqlCommand
cmd = New SqlCommand("roll2", con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(t1.Text, SqlDbType.Char, 10, "@rollnumber")
Dim ad As New SqlDataAdapter(cmd)
Dim ds As New DataSet
ad.Fill(ds)
gv1.DataSource = ds
gv1.DataBind()
con.Close()
Problem is in bold and underlined.
t1 is textbox
|
|
|
|
|
|
I want to know the underlined and bold line has the correct syntax.
|
|
|
|
|
mmm. but it's much simpler to figure out the problem if you have run the code and got an error.
|
|
|
|
|
I just want to know are the parameters given to the add function are accordingly given or or ther is some hotch potch.
|
|
|
|
|
hi all,
I have a Same Web Service on 3 differnt Comp . i want to add only one of these 3 services Dynamically ,Can Any one tell me how to do this .
|
|
|
|
|
Hey all
I have a formView control on my page and I want to add a programmatically created insert item template to it. Is there any way to create the template with controls already on it and then add it to the formView?
Thanks in advance
|
|
|
|
|
|
Cheers mate, my google search techniques must be poor as I didn't come accross that
|
|
|
|
|
How to create dynamic menu in asp.net 1.1
Is there any menu free tool available?
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
There are a few approaches you can take:
One is using Javascript (I haven't tried it)
Another is creating a table and an indenting structure to represent a heirarchy. IDing those rows, you can toggle visibility on and off from code behind.
Last approach is.. try looking up Tree View.
Hope this helps.
Happy Coding.
|
|
|
|
|
Hello,
How can I encrypt web config section which is outside web.config file?
E.g.
<connectionStrings configSource="ConfigFiles\connectionStrings.config"/>
If I use
aspnet_regiis -pef "connectionStrings" "FilePath" -prov "MyProvider",
It does encrypt if the section is there inside web.config, but if the section is outside web.config, how can we encrypt that. Is there some way we can achieve this?
Thanks and regards,
- ashish
|
|
|
|
|
Hi Ashish,
Use CipherData Class for encrypting it.
With Regards
Satips
|
|
|
|
|
Hi,
I have a dropdown list which has data bound to it from a User Table. The DropDownList currently displays the Surname of the user.
I would like it to display the Forename AND the Surname. Any ideas?
Thanks.
|
|
|
|
|
You can get the desired full name from the database itself by combining the two..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Solved it in the following way;
Using this query : "SELECT inUserID, Surname + ', ' + Forename AS ForenameANDSurname FROM tblUser"
Set the following :
Me.ddlDropDownList.DataTextField = "ForenameANDSurname"
and Finally set the DataTextField attribute in the DropDownList WebControl to "ForenameANDSurname" as well.
Did the trick.
Thanks for the reply anyway I think I did what you meant.
If anyone needs more indepth info, try :
http://authors.aspalliance.com/aldotnet/examples/doublecolumnddl.aspx[^]
OR: search "DropDownList multiple columns" in google or something.
|
|
|
|
|
here i have a problem that ,i want to set some (x,y) value for each pixels for an image.when i am giving the input (x,y) values ,the program should find the exact (x,y) values in the image and set some small mark there.for this-
1)how to set values for each pixels?
2)what is the code for finding exact position in the image ,when i am inputting the cordinate values?
3)how to differentiate pixel colors in asp.net?
for all this i am using asp.net with c#.
share your knowledge in this..
"we may not win immediately..
but we will win defenetly..."
|
|
|
|
|
i want to get the contains of XML file into Html tag.the summary is tht i develop a template site whn user filled his/her detail into asp.net web page and submit them thn a web page is ready for the user according to his/her detail as well as store into sql server 2005. thn i think we store his detail into database and create a xml file according to his detail.after tht i want to get these detail into html page bcoz we give tht web page copy to the user.
Deepak
|
|
|
|
|
you can use xml control to do this. the xml control has two properties
document src file--->you have to give the xml file here
transporm source file ---- give xslt file here
do you know this or want furthur help?
Nizha
|
|
|
|
|
I have to display database values into textboxes,if db values are null,it should display a blank spaces in respective txtboxes,how to compare
Txtpays.Text = ds.Tables("employee").Rows(r)("Pay_Scale")
if pay_scale is null,how to check before display
,give me correct solution
-- modified at 3:58 Wednesday 27th September, 2006
|
|
|
|
|
You can check that using DBNull.Value
Best Regards,
Apurva Kaushal
|
|
|
|