I am working with Vb.Net and asp.net, I have two forms and I want to match the refNo from one form to another, please help
If saved_prac = "" Then
MsgBox("This reference number doesn't exist", MsgBoxStyle.Information, "Change Control Management System")
Else
txtsrch.Text = ~/default/txtref.text
Response.Redirect("~/Mainpages/Default.aspx")
End If
and on ~/Mainpages/Default.aspx - page_load I have;
conn.Open()
Try
query = "SELECT RefNo FROM dbo.TblChangeControlDet WHERE RefNo='" & _
txtsrch.Text & "' "
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "Change Control Management System")
End Try
Dim saved_prac As String
saved_prac = cmd.ExecuteScalar()
If saved_prac = "" Then
MsgBox("This reference number doesn't exist", MsgBoxStyle.Information, "Change Control Management System")
Else
Session["RefNo"] = txtsrch.Text
Response.Redirect("~/Mainpages/Default.aspx")
End If
End If
conn.Close()
If txtref.Text <> "" Then
Dim ReferenceNumber As String = Convert.ToString(Session("RefNo"))
txtref.Text = ReferenceNumber
End If
Dim saved_prac As String
conn.Open()
Try
query = "SELECT RefNo FROM dbo.TblChangeControlDet WHERE RefNo='" & _
txtsrch.Text & "' "
cmd = New SqlCommand(query, conn)
saved_prac = cmd.ExecuteScalar()
Catch ex As Exception
Response.Write("Change Control Management System")
End Try
conn.Close()
If saved_prac = "" Then
Response.Write("Change Control Management System")
Else
Session["RefNo"] = txtsrch.Text
Response.Redirect("~/Mainpages/Default.aspx")
End If
dr223
Member
8 Points
350 Posts
textboxes
Nov 06, 2012 02:39 PM|LINK
Hi,
I am working with Vb.Net and asp.net, I have two forms and I want to match the refNo from one form to another, please help
If saved_prac = "" Then MsgBox("This reference number doesn't exist", MsgBoxStyle.Information, "Change Control Management System") Else txtsrch.Text = ~/default/txtref.text Response.Redirect("~/Mainpages/Default.aspx") End Ifdinord2005
Member
160 Points
34 Posts
Re: textboxes
Nov 06, 2012 02:49 PM|LINK
Hello,
Have you tried caching?
My best regards
dr223
Member
8 Points
350 Posts
Re: textboxes
Nov 06, 2012 02:54 PM|LINK
How can I do that please?
dinord2005
Member
160 Points
34 Posts
Re: textboxes
Nov 06, 2012 02:58 PM|LINK
This topic will help you : http://www.tutorialspoint.com/asp.net/asp.net_data_caching.htm
My best regards
Alsaady
Contributor
2024 Points
417 Posts
Re: textboxes
Nov 06, 2012 03:27 PM|LINK
Hi
you cant use msgbox in asp.net
and whole code ?
are you means that compare between 2 textbox on two page?
www.rtoosh.net
dr223
Member
8 Points
350 Posts
Re: textboxes
Nov 06, 2012 03:40 PM|LINK
and on ~/Mainpages/Default.aspx - page_load I have;
conn.Open() Try query = "SELECT RefNo FROM dbo.TblChangeControlDet WHERE RefNo='" & _ txtsrch.Text & "' " cmd = New SqlCommand(query, conn) cmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Information, "Change Control Management System") End Try Dim saved_prac As String saved_prac = cmd.ExecuteScalar() If saved_prac = "" Then MsgBox("This reference number doesn't exist", MsgBoxStyle.Information, "Change Control Management System") Else Session["RefNo"] = txtsrch.TextResponse.Redirect("~/Mainpages/Default.aspx") End If End If conn.Close()If txtref.Text <> "" Then Dim ReferenceNumber As String = Convert.ToString(Session("RefNo")) txtref.Text = ReferenceNumber End IfThis doesnt work!! Why
Alsaady
Contributor
2024 Points
417 Posts
Re: textboxes
Nov 06, 2012 04:02 PM|LINK
Dim saved_prac As String conn.Open() Try query = "SELECT RefNo FROM dbo.TblChangeControlDet WHERE RefNo='" & _ txtsrch.Text & "' " cmd = New SqlCommand(query, conn) saved_prac = cmd.ExecuteScalar() Catch ex As Exception Response.Write("Change Control Management System") End Try conn.Close() If saved_prac = "" Then Response.Write("Change Control Management System") Else Session["RefNo"] = txtsrch.TextResponse.Redirect("~/Mainpages/Default.aspx") End Ifwww.rtoosh.net
dr223
Member
8 Points
350 Posts
Re: textboxes
Nov 06, 2012 04:09 PM|LINK
Error Message:
Property access must assign to the property or use its value.
Identifier expected...
Thanks
Alsaady
Contributor
2024 Points
417 Posts
Re: textboxes
Nov 06, 2012 04:15 PM|LINK
Session("RefNo") = txtsrch.Textwww.rtoosh.net
Dave_Winches...
Contributor
3051 Points
716 Posts
Re: textboxes
Nov 06, 2012 04:16 PM|LINK
Hi
Why not just pass the value on the querystring:
And then,
Seems simple enough to me.
/D
Please mark as ANSWER if this is the solution.