Showing posts with label second. Show all posts
Showing posts with label second. Show all posts

Thursday, March 29, 2012

Pass message

Dear,

Please let me know about querystring or howevery u know.Im tyring to pass one message one aspx page to second aspx page how can i make sentence.plz write down for me with example

This may help:

http://msdn.microsoft.com/msdnmag/issues/07/03/CuttingEdge/default.aspx?loc=en
http://www.codeproject.com/aspnet/QueryString.asp
http://www.eggheadcafe.com/articles/20060427.asp

I hope it helps. Regards,


Check below my blog post

Ways to pass data between webforms

HC

Monday, March 26, 2012

Pass two values in querystring

I am trying to pass two values in a querystring. I have no problem passing one but when I try to pass two the second doesn't work.

Heres an example of what I'm doing:

Response.Redirect(passingpage.aspx&value={0}&value2=" & txtvalue2.Text)

The first value is from a hyperlink column of a datagrid which works fine by itself. When I try to pass the second value from a textbox, it doesn't work. I'm using visual basic.

Can anyone help?the first parameter is denoted by a ? and the subsequent ones a &

eg

http:www.costall.com/default.aspx?param1=hello&Param2=world

does this answer the question or is it a typo in the post?
I have tried that and it doesn't work. Any other suggestions?
can you post the code sample?
Hello, try this:

Dim url As String = "passingpage.aspx?value1=" & txtValue1.Text & "&value2=" & txtValue2.Text
Response.Redirect(url)

regards

Pass value to second DropDownList from the first one

I want pass value to 2nd DropDownList from 1st one. I use "DropDownList1.SelectedValue", but got error message." can't transfer data type from varchar,..." Yes, in Database, it is varchar type.

Here is a source code:

private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
string sql = "select Address from myTable where Name=" + DropDownList1.SelectedValue ;
SqlConnection con = new SqlConnection(connectionString);
SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
da.Fill(ds, "myTable");
DataView dv=ds.Tables [0].DefaultView ;

DropDownList2.DataTextField="Address";
DropDownList2.DataValueField ="Address";
//DropDownList2.DataSource =ds.Tables[0].DefaultView;
DropDownList2.DataSource=dv;
DropDownList2.DataBind ();

con.Close();
}

Two things.

1) I would use a SqlDataReader to populate the DropDownList. It is 100x faster than a DataSet.

2) Try DropDownList1.SelectedItem.Value to get the value of the DropDownList


move your datasource code line above both your datatextfield and datavaluefield

[edit]

He is right about the speed--much faster.


I did try: DropDownList1.SelectedItem.Value, but got same error msg.

You are missing the single quotes around the parameter, try:

string sql = "select Address from myTable where Name='" + DropDownList1.SelectedValue + "'" ;


Better NOW.

pass value to the second page

hi,
i am new to asp.net. here is what i want to do. i have 2 aspx pages,
first.aspx and second.aspx
now from the first.aspx i want to give the second.aspx page values like
second.aspx?DownloadFile=1
so, the second page give the user the requested file for download.
any suggestions, i am doing it in vb.net ?
and can somone recommend a ASP.NET via VB.NET book.
thanks,
ABabhishek007p@.hotmail.com wrote:
> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
>
how are you getting to the second page? Just write the QueryString onto
the link, or in the redirect.
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Hi AB,
I think this book is good cause the other is recognized as a good teacher.
I haven't read it though (I came from classic asp and read on the internet
the howto's)
http://www.amazon.com/exec/obidos/t...=books&n=507846
Jesse Liberty also knows how to write a book :
http://www.amazon.com/exec/obidos/t...=books&n=507846
The simplest way to solve your problem is to do a response.redirect to the
file you wish to push to your user.
Let me know if you have any more questions...
Cheers,
Tom Pester

> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values
> like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
Also a video says more than 1000 pictures :
http://www.microsoft.com/events/ser...tialaspnet.mspx
Cheers,
Tom Pester

> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values
> like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
> how are you getting to the second page? Just write the QueryString onto
> the link, or in the redirect.
hi,
via redirect.
thanks,
hi,
thanks a lot everyone. i have sloved the problem!
here is how:
First.aspx
Private Sub LinkButton1_Click(...bla bla)
Response.Redirect("second.aspx?DownloadFile=1")
End Sub
Second.aspx
Private Sub Page_Load(...bla bla)
Dim MyTemp As String
MyTemp = Request.Item("DownloadFile")
Select Case MyTemp
Case "1"
Response.Redirect("MyFile1.zip")
Case "2"
Response.Redirect("MyFile2.zip")
Case Else
MsgBox("Hello World", MsgBoxStyle.Information)
End Select
End Sub
thank, bye,
AB
This article provides some useful samples about uploading and downloading
files with ASP.NET:
http://SteveOrr.net/articles/EasyUploads.aspx
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
<abhishek007p@.hotmail.com> wrote in message
news:1123534014.754404.8740@.f14g2000cwb.googlegroups.com...
> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
>

pass value to the second page

hi,

i am new to asp.net. here is what i want to do. i have 2 aspx pages,
first.aspx and second.aspx

now from the first.aspx i want to give the second.aspx page values like

second.aspx?DownloadFile=1

so, the second page give the user the requested file for download.

any suggestions, i am doing it in vb.net ?

and can somone recommend a ASP.NET via VB.NET book.

thanks,
ABabhishek007p@.hotmail.com wrote:
> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB

how are you getting to the second page? Just write the QueryString onto
the link, or in the redirect.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Hi AB,

I think this book is good cause the other is recognized as a good teacher.
I haven't read it though (I came from classic asp and read on the internet
the howto's)
http://www.amazon.com/exec/obidos/t...=books&n=507846
Jesse Liberty also knows how to write a book :
http://www.amazon.com/exec/obidos/t...=books&n=507846

The simplest way to solve your problem is to do a response.redirect to the
file you wish to push to your user.

Let me know if you have any more questions...

Cheers,
Tom Pester

> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values
> like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
Also a video says more than 1000 pictures :

http://www.microsoft.com/events/ser...tialaspnet.mspx

Cheers,
Tom Pester

> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values
> like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB
> how are you getting to the second page? Just write the QueryString onto
> the link, or in the redirect.

hi,

via redirect.

thanks,
hi,
thanks a lot everyone. i have sloved the problem!

here is how:

First.aspx
Private Sub LinkButton1_Click(...bla bla)
Response.Redirect("second.aspx?DownloadFile=1")
End Sub

Second.aspx
Private Sub Page_Load(...bla bla)
Dim MyTemp As String
MyTemp = Request.Item("DownloadFile")

Select Case MyTemp
Case "1"
Response.Redirect("MyFile1.zip")
Case "2"
Response.Redirect("MyFile2.zip")
Case Else
MsgBox("Hello World", MsgBoxStyle.Information)
End Select
End Sub

thank, bye,
AB
This article provides some useful samples about uploading and downloading
files with ASP.NET:
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

<abhishek007p@.hotmail.com> wrote in message
news:1123534014.754404.8740@.f14g2000cwb.googlegrou ps.com...
> hi,
> i am new to asp.net. here is what i want to do. i have 2 aspx pages,
> first.aspx and second.aspx
> now from the first.aspx i want to give the second.aspx page values like
> second.aspx?DownloadFile=1
> so, the second page give the user the requested file for download.
> any suggestions, i am doing it in vb.net ?
> and can somone recommend a ASP.NET via VB.NET book.
> thanks,
> AB

Wednesday, March 21, 2012

passing a DropdownList value to another wizard step?

I have a wizard that has 3 wizardSteps. The first one is selecting a
NewsArticle from the combobox to edit. The second wizardStep (pressing next)
loads the whole database record into a form. The third step would be for
them to confirm the changes before submitting. I know how to get the confirm
part to work as well as the update part itself but how would I get the
combobox step to load the whole record into a form in the next wizardStep?On 10 Jan, 00:11, "Andy B" <a_bo...@.sbcglobal.net> wrote:
> I have a wizard that has 3 wizardSteps. The first one is selecting a
> NewsArticle from the combobox to edit. The second wizardStep (pressing nex
t)
> loads the whole database record into a form. The third step would be for
> them to confirm the changes before submitting. I know how to get the confi
rm
> part to work as well as the update part itself but how would I get the
> combobox step to load the whole record into a form in the next wizardStep?
Hi Andy,
Could you not put the combo box value into the query string, or into
session?
Another, more complex apprach would be to write the value using
JavaScript into a hidden field value then pick it up as step 2 loads.
HTH,
Jon
www.nantwichonline.com/pubs

Friday, March 16, 2012

Passing an array as a session variable

I have 2 asp.net forms. In the first form I create a one dimensional array and copy that array into a session object. In the second form I want to read the elements of that array. Everything I've tried results in either a casting error, a late binding error or nothing at all. The following code shows what Iwant to do.

Form one: Dim aArray(2) as stringaArray(0) = "zero"aArray(1) = "one"Session("PassArray") = aArray
Form two: Dim aTest(2) as stringaTest(0) = CType(Session("PassArray(0)"), String)aTest(1) = CType(Session("PassArray(1)"), String)When I run form two in the editor, I can Watch Session("PassArray") and see:Session("PassArray") {System.Array} object-- (0) "zero" string-- (1) "one" stringSo I know it's there and available, but how do I read the extents.

Could really use a simple code example to explain what I'm doing wrong.

Hi,

Use this on the second form:

Dim aTest() As String = CType(Session("PassArray"), String())


That did it. Thank you.