SqlDataSource events selecting and selected not work

When I handle a event for selecting to change the value of a parameter it does not use the new value and the selected event is never called. What am I doing wrong?

 

protected void OptionListSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)

{

string productID = Request.QueryString["p"].ToString();

SqlDataSourceView Source = (SqlDataSourceView)sender;

Source.SelectParameters["ProductID"].DefaultValue=productID;

}

protected void OptionListSource_Selected(object sender, SqlDataSourceStatusEventArgs e)

{

SqlDataSourceView Source = (SqlDataSourceView)sender;

}

0
Symbios
12/28/2005 10:08:36 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
808 Views

Similar Articles

[PageSpeed] 53

It probably realizes that the data it already has doesn't need to be refreshed.

Change the ProductID parameter from type "none" to type "QueryString", and tell it to use the "p" querystring key, and delete both functions, and your problem will go away.

0
Motley
12/29/2005 6:11:20 AM
Reply:

Similar Artilces:

SqlDataSource Selecting/Selected events not firing
Hi,I have a SqlDataSource and am trying to establish if it returns rows using the selected event e.AffectedRows statement. Unfortunately the selected event does not fire. I am using a stored procedure with 2 parameters:applicantID - Int32 - Parameter source from control label textissueStatus - Int16 - Parameter source 'None' default value = 1 When i test it during configuration it returns 1 row as expected. I am manually running the DataSource using ds.DataBind(); after a button click. Anyone know why its not firing the event?Thanks  Solved it. The problem was with...

SELECT from SELECT
Hi! I remember seeing an example where you can do a select from a nested select, but I cannot seem to make it work. So it would be something like this: select max( name ) from ( select name from customer union select name from vendor ) Was I dreaming I saw that? Thanks! D In article <4500243f@forums-2-dub>, daniel_AT_infrontsoftware_DOT_com@N0SPAM.com says... > Hi! > > I remember seeing an example where you can do a select from a nested > select, but I cannot seem to make it work. No, you weren't. Try (UNTESTED!) adding a...

string sql = "SELECT * FROM Office; SELECT * FROM Room"; DO NOT work with Access??
Hi I am trying to create a nested datagrid and I am using this tutorial; http://www.dotnetjunkies.com/Tutorial/47792CB0-0990-4BD8-BF84-B6063C4C9BBC.dcik I am using C# ASP.NET and Access database. This is my code; string sqlStmt = "SELECT * FROM Office; SELECT * FROM Room"; roomDataAdapter = new OleDbDataAdapter(sqlStmt, connection); roomDataAdapter.Fill(roomDataSet); roomDataSet.Tables[0].TableName = "Office"; roomDataSet.Tables[1].TableName = "Room"; Error message: System.Data.OleDb.OleDbException: Characters found after end of S...

Why is the select saying selected after an item is selected?
This was a whitelisting issue due to a software upgrade at hostgator..  Nothing wrong with my code..Scot King SEO Software Tool | Search Engine Optimization"Get your page rank high"  huh? It is smart to put your question in the body and not just in the title. Have no idea what your question is or if it even a question.Eric Pascarello.com | Twitter epascarello | LinkedIn use thisddl.options[ddl.selectedIndex].selected = false; //Clear the selection ddl.options[1].selected = trueMAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Sit...

select cheboxlist if any values are selected in sql
hello and thanks in advance,  I have a checkboxlist that is created dynamically from table1 once the records are inserted they are inserted in table2. i can save the values into the table and remove them if i uncheckd them that is working fine. the problem is to checked the items that have been selected already, how to i do this?? really really confuse...   here is the cs code; namespace IMS_2K9.Admin { public partial class Order_Charges : System.Web.UI.Page {private string connectionString = WebConfigurationManager.ConnectionStrings["IMSCon...

Quick Select & SQL Select
What difference between "Quick Select" & "SQL Select" in DataWindow ? E-mail me PLS -- Leonid ANTISPAM ! SORRY!!! My e-mail is not correct: zzz_leo@softincom.ru Remove 'ZZZ_' from E-mail ICQ UIN: 7281017 Quick Select uses wizards and has limited capabilities. SQL Select is a point and click and lets you do a lot more. Plus you need to know the SQL Select approach if you want to modify a Quick Select after the initial creation. HTH, Mark -- Mark Pfeifer[Team PS] mpfeifer@sprynet.com ** ARE YOU READY FOR THE WEB...

Multiple Selects
Is it possible to specify more than one select in the Infomaker SQL Select Painter? Example: SELECT Tab1.Num FROM Tab1 SELECT Tab2.Ref FROM Tab2 If it is possible, please let me know how can I do that. If it isn't possible, how can I overcome this issue? Thanks and regards, Filipe Freitas Yes, inside a UNION. "Filipe Freitas" <filipe.freitas@hp.com> wrote in message news:435f98ea$1@forums-2-dub... > Is it possible to specify more than one select in the Infomaker SQL Select > Painter? > > Example: > SELECT Tab1.Num FROM Tab1 ...

Selecting event in SqlDataSource
I am looking for a good SqlDataSource event where I can add a parameter. I have tried to use Selecting, but I am getting error "System.Data.SqlClient.SqlException: Procedure 'usp_clearinghouse_find' expects parameter '@_chrOrganization', which was not supplied", so parameter is not registering before the data is pulled.I have tried to use Init, Load, but these don't work either. Any suggestions? You should look at the datasource itself: protected void SqlDataSource3_Inserting(object sender, SqlDataSourceCommandEventArgs e) { FileUpload stateTextBox = (FileUpload)DetailsView1.Rows...

Assigning Select Parameters in Selecting event too late
I had some code in the SQLDataSource selecting() event which set all my selectparameters to control values on the page (e.g. SQLDataSource.SelectParameters(0).DefaultValue = ....). However I was finding that after databinding, the SQLDataSource was only actually sending the newly assigned parameters in the 2nd call to the stored procedure. So the underlying rule seems to be don't set your select parameters in the Selecting() event of your SQLDataSource as this is too late.  I've moved it into a button click handler before the databind() was called on my GridView.  I'm s...

Select within a select not working in block syntax
Oracle version 8i I have a block like this (edited to the minimum to reproduce the error): declare  ret0000 ref cursor;beginopen ret0000 for select ACCOUNTID, apcancelleddate, donotcancelindicator, NVL(exhaustionstatus,0) as Exhaust, estimatedrefundamount,refundamount, ancillary_shortage_amt,(Select count(*) from ap_refund where ap_id = vap.ancillaryproductid and satisfy_ind = 'Y') as APCountfrom vap, ars_variable where ars_variable.ID = 1 and ACCOUNTID in (319146, 311169, 80454, 319055, 514742, 319095, 311112, 311111, 311143, 514722);end;When I attempt to execute I get th...

Raise Event when a selected date is selected again in Calendar
Hi all,When I view source of the rendered page that contains a calendar control, I see it's a table, with a child table where each date is a table cell calling the all powerful __dopostback function with the calendar id as the event target and a unique numeric string as the event argument.Since the selected date is also containing the dopostback function, could that be exploited to call a routine during page load due to postback.I have come upto this and got stuck after that.'aspx.vb code snippet:If TypeOf sender Is Control Then     dim ctl as control  &...

Iwant to select a row and column in gridview with select radiobutton. but No checked change event.below put a button .if click that button to seleced row values will select
I want to select a row and column in gridview using radiobutton in gridview . if which radio button is select that row will select and i want that row column values in outside individual textboxes of next page.  but in that only single radiobutton will select and no post back="true" bcz iam not using checked change property. i inserted button below gridview. if i click the that selected row and columns values are stored into textboxes of next page im using this code .but im getting one column in that row. but i want all columns in that selected row so plz repla...

2 sql select statements in 1 sql string just wont work!
hi there, i have a bit of a strange problem, and i must be doing something wrong because this works with insert and update statements in other pages. What is going on is that i am trying to do 2 select statements in the same bit of code so i dont have to open a datareader twice, but if i put the delivery charge select before the other it seems to get it, but if i put it after it does not, i just cant work it out! i have posted my code below for you all to have a look at because im stumped! //gets order id and customer id and puts them to strings and int to be used laterstring strCustID = Re...

dropdown box selected index event not working and session start event restarting
Edited by SomeNewKid. Please post code between <code> and </code> tags. i have used a dropdown box in my page and have 3 items in that 1)select year 2)2004 3)2005 . The first one will be shown default in the page to force the user to select the year . I have defined dropdow selection changed event in which I enable other tect boxes for editing . However i am encountering following problems (Page x) 1)When user selects 2005 , vent doesn't fire 2)When user selects 2004 event fires 3)After selecting 2004 if user selects 2005 event fires . 4)Another peculia...

Web resources about - SqlDataSource events selecting and selected not work - asp.net.sql-datasource

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Using The LINQDataSource
-*+There is a new datasource control available in Visual Studio that works in much the same way as the SQLDataSource and the ObjectDataSource. ...

Gabriel Mongeon
Archive - Gabriel Mongeon

moredotnet
M ore d otnet .NET Interview Questions, ASP.NET, C#, VB.NET, XML, SQL Check Out http://www.dotnetUncle.com √ .NET NOTES OOPS in .NET .NET ...

Architectural Overview of the Windows Presentation Foundation Beta 1 Release
Introduction Windows Presentation Foundation Beta 1 Windows Integration New Features WinFX SDK Exploring the New Features Introducing "Express" ...

About Mikesdotnetting
I started this site as somewhere to store answers to bits and pieces that I see asked frequently in the forums at www.asp.net . Rather than type ...

Using MiniProfiler with SqlDataSource ASP.NET WebForms Control
public class ProfiledSqlDataSource : SqlDataSource{ protected override DbProviderFactory GetDbProviderFactory() { // get the "base" DbProviderFactory ...

ASP.NET Pivot Table - RadPivotGrid for ASP.NET AJAX
... reports. RadPivotGrid allows easy customization of all data reports. Try now! Use any declarative data source control (AccessDataSource, SqlDataSource, ...

Sign on
Sign On • Join • Forums Home User Name * Password * Remember me next time ( I forgot my password ) SUBMIT YOUR WTF Content Random Article All ...

ComboBox Sample
ComboBox is an ASP.NET AJAX control that, like the AutoCompleteExtender , combines the flexibility of a TextBox with a list of options that users ...

Resources last updated: 12/29/2015 8:06:35 PM