Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2006, 04:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What do you mean with "get the return value twice "??

Is the event handler SqlStatus_Updated firing twice?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 27th, 2006, 05:00 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

HI Imar

I have found the culprit!.. just now.

'Handles SqlGCIStatus.Updated' When I remove this from the event handler it returns the value once but when added I get it twice.
 
Old February 27th, 2006, 05:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That's probably because you have an OnUpdated handler in the markup for the control as well.

In that case, the handler is hooked up twice, and it'll fire twice...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 27th, 2006, 05:31 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Excellent, thanks for your help. One last thing if you don't mind..

Within this SELECT CASE statement I want to bind the result to a Label but for some reason it doesn't like it.. page still loads but the label is not showing any text..

Code:
SELECT CASE ReturnStatus
                CASE 1
                     lblalert.Text = "Username Already in Use"
                CASE 2
                     lblalert.Text = "Saved!"
        END SELECT
And I declare my Label like so...
Code:
Dim lblalerttext As Label = _
CType(FormView1.FindControl("lblAlertsaved"), Label)
I have checked the value of the 'ReturnStatus' which either show 1 0r 2 (Integer)

Ta

Rit
 
Old February 27th, 2006, 05:33 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

sorry lblalerttext = lblalert... just in my example above is wrong.
 
Old February 27th, 2006, 01:47 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Where did you declare the label? Inside a template for the FormView? In that case,is it possible that the selected template is no longer visible after you performed the update? (That is, the Label is defined in the Update section??)

Can't you just add the Label to the page, outside the FormView and directly change its Text?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 28th, 2006, 07:57 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Blimey it must be like helping a monkey... sorry about that... I have set it in the page and it works fine.

No disrespect to monkeys by the way!

Rit
 
Old February 28th, 2006, 09:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No offense taken.... ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
pre checking of submitted data bond007 PHP How-To 1 October 15th, 2008 11:24 PM
Data reader checking.... janees ASP.NET 1.0 and 1.1 Professional 1 March 11th, 2007 06:09 AM
Inserting data when data already exsist desireemm SQL Language 0 January 16th, 2006 11:01 PM
Checking a Database before Inserting a Record vbmazza VB Databases Basics 2 April 28th, 2005 07:23 AM
Compile Time Data Type Checking c3nty@yahoo.com C# 0 September 18th, 2003 01:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.