Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

validation page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JJ297 - 16 Aug 2007 13:24 GMT
I'm getting an error message on my validation page on this bit of
code:

If Request.QueryString = "" Then
           Response.Redirect("cdpadmineditpage.aspx")
       End If

This is the error message:
Overload resolution failed because no accessible '=' can be called
with these arguments:
'Public Shared Operator =(a As String, b As String) As Boolean': Value
of type 'System.Collections.Specialized.NameValueCollection' cannot be
converted to 'String'.

I have a generated email going to someone when users enter a
question.  The person answering the email will get a link to that
question.  That link takes them to edit page with the question ID in
the querystring.

Here's the info that generates an email which is on another page.

Dim x As Integer
x = cmd.ExecuteScalar 'will bring back my quesID for the email
command.ExecuteNonQuery()

           Dim ocdoEmail As New Object
           ocdoEmail = Server.CreateObject("CDO.Message")
           ocdoEmail.To = Session("GetEmail")
           ocdoEmail.From = Session("GetEmail")
           ocdoEmail.Subject = "EDCS Question"
           ocdoEmail.HTMLBody =
"<a href=""http://seb2a54/cdpedcsfaqs/cdpadminEditpage.aspx?quesid=" &
x & """>
Click to view question that was submitted.</a>"

           ocdoEmail.send()

How do write the code if the user is coming in from a querystring then
let them have access to that page when they click on the link when I'm
using ExecuteScalar?

If Request.QueryString = ??? Then
           Response.Redirect("cdpadmineditpage.aspx")
       End If

Thanks!
JJ297 - 16 Aug 2007 14:10 GMT
> I'm getting an error message on my validation page on this bit of
> code:
[quoted text clipped - 42 lines]
>
> Thanks!

Figured it out...
If Request.QueryString("quesid") = "" Then
           Response.Redirect("cdpadmineditpage.aspx")
       End If
Ladislav Mrnka - 17 Aug 2007 02:04 GMT
Hi,

if you are trying to test if query string exists use If
Request.QueryString.Count = 0.

Regards,
Ladislav

> I'm getting an error message on my validation page on this bit of
> code:
[quoted text clipped - 42 lines]
>
> Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.