Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hai,

I am trying to transfer some values from page1 to page2.In page1 i am sending the values through a button click event and receiving the values in page2 on my pageload event.I get the error object reference not set to an instance of an object.anybody pls help.

thanks.

 

 

page1.aspx

 

'on button clicked it has to go to page2.aspx

If (p_daily.Checked) Then

Context.Items.Add("site", p_siteid.SelectedItem.Value())

Context.Items.Add("daily", p_daily1.Text())

Server.Transfer("page2.aspx")

End If

If (p_from.Checked) Then

Context.Items.Add("site", p_siteid.SelectedItem.Value())

Context.Items.Add("from", p_from1.Text())

Context.Items.Add("to", p_to.Text())

Server.Transfer("page2.aspx")

End If

 

 

In page2.aspx i am receiving the values in my pageload event.

but i am getting the error Object reference not set to an instance of an object.

 

Page2.aspx.

 

 

 

If Not Page.IsPostBack Then

 

Dim s, s1, s2, s3, s4, s5, strscript As String

s = ""

s1 = ""

s2 = ""

s3 = ""

s4 = ""

s = context.Items("daily")

s1 = context.Items("site")

s2 = context.Items("from")

s3 = context.Items("to")

 

 

If s.Length <> 0 Then

 

 

Dim myConnection As New SqlClient.SqlConnection

myConnection.ConnectionString = tq()

 

'database connections and query goes here.............

 

End If

 

 

 

If s2.Length <> 0 And s3.Length <> 0 Then

 

 

Dim myConnection As New SqlClient.SqlConnection

myConnection.ConnectionString = tq()

 

'database connections goes here....................

 

End If

 

end if

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...