Forms Data Controls :: Selectparameter Not Passed?

Jan 11, 2010

I am really sorry for this, but this is such a bizarre situation I don't know where to turn. I have a stored procedure that takes four parameters (two dates, a positionID, a userID). The SQLDataSource is very generic:

[Code]....

and I set the parameters via this code:

[Code]....

When this executes, no matter what the value of PositionID, it acts as if the PositionID is zero. Now, if I remove PositionID variable and add the number:

[Code]....

All is well. Also, when I look at the parameter in the immediate window, it appears to be correct:

[Code]....

View 5 Replies


Similar Messages:

Forms Data Controls :: Can't Set SelectParameter Value For Nested ListView

May 24, 2010

I am trying to get my Nested ListView to work. I have my parent List View supplying the correct information, but I can't seem to set the SelectParameter Value for my Nested ListView. I am using SQLDataSources for both. I read your comment about adding a Hidden Field. Where Should that field be located. Right now I have it inside my Parent ItemTemplate but nothing is happening. Currently I have both DataSource outside my Parent ListView. I tried moved the nested ds inside with the list view but I still was not able to grab the hidden field values either. Here's what I have:

<asp:ListView
ID="lv"
runat="server"
DataSourceID="sdsParent"
DataKeyNames="CaseNo">
<LayoutTemplate>
<div
class="grid">
<h2>Bankruptcies
by RetailerID <asp:ImageButton
ID="btnSort"
runat="server"
ImageUrl="images/sort_asc.gif"
ImageAlign="AbsMiddle"
CommandName="Sort"/></h2>
<table
id="tblBankruptcy"
cellpadding="0"
cellspacing="0">
<tr
class="head">
<th
class="first"></th>
<th>Retailer
ID</th>
<th>Retailer
Name</th>
<th>Chapter
Number</th>
<th>District</th>
<%
&nbsp;
--<th>Date</th>--%></tr>
<tr
id="itemPlaceholder"
runat="server"
/>
</table>
<table
id="pager"
cellpadding="0"
cellspacing="0">
<tr
class="pager">
<asp:DataPager
ID="pager"
runat="server"
PageSize="8">
<Fields>
<asp:TemplatePagerField
OnPagerCommand="PagerCommand">
<PagerTemplate>
<td
class="commands">
<asp:ImageButton
ID="btnFirst"
runat="server"
CommandName="First"
ImageUrl="images/first.gif"
AlternateText="First Page"
ToolTip="First Page"
/>
<asp:ImageButton
ID="btnPrevious"
runat="server"
CommandName="Previous"
ImageUrl="images/prev.gif"
AlternateText="Previous Page"
ToolTip="Previous Page"
/>
<asp:ImageButton
ID="btnNext"
runat="server"
CommandName="Next"
ImageUrl="images/next.gif"
AlternateText="Next Page"
ToolTip="Next Page"
/>
<asp:ImageButton
ID="btnLast"
runat="server"
CommandName="Last"
ImageUrl="images/last.gif"
AlternateText="Last Page"
ToolTip="Last Page"
/>
</td>
<td
class="info">
Page
<b>
<%
&nbsp;
# Container.TotalRowCount > 0 ?
Math.Ceiling(((double)(Container.StartRowIndex &#43; Container.MaximumRows)
/ Container.MaximumRows)) : 0 %></b>
of
<b>
<%
&nbsp;
#
Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows)%></b>
(<%
&nbsp;
&nbsp;
# Container.TotalRowCount %> items)
</td>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>
</tr>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<%
&nbsp;
<%
&nbsp;
-- <table id="orders" cellpadding="0" cellspacing="0">--%><tr
id="itemPlaceholder"
runat="server"
/>
-- </table>--%><tr
id="row"
runat="server"
class="group">
<th
class="first">
<img
src="images/plus.png"
alt='Group:
<%# Eval("CaseNo")%>'
onclick="toggleGroup(this, '<%# Eval("RetailerId") %>');"
/>
</th>
<th
colspan="1">
<%
&nbsp;
# Eval("RetailerId")%>
</th>
<th>
<%
&nbsp;
# Eval("RetailerName")%></th>
<th>
<%
&nbsp;
# Eval("BankruptcyTypeID")%>Chaper 11</th>
<th>
<%
&nbsp;
# Eval("DistrictID")%>District</th>
</tr>
</ItemTemplate>
<SelectedItemTemplate>
<asp:ListView
ID="lvItems"
runat="server"
DataSourceID="sdsChild">
<LayoutTemplate>
<tr
runat="server"
id="itemPlaceholder"
/>
</LayoutTemplate>
<ItemTemplate>
<tr
class="item">
<th></th>
<th>Action</th>
<th>Comments</th>
<th>Attorney
Information</th>
<th>Date</th>
</tr>
<tr
id="row"
runat="server"
class="item">
<td
class="first"></td>
<td><%#
Eval("ActionID")%></td>
<td><%#
Eval("CaseNo")%></td>
<td><%#
Eval("Comments")%></td>
<td><%#
Eval("AssigneId") %></td>
<td><%#
Eval("Date",
"{0:MM/dd/yyyy}")%></td>
<td><%#
Eval("CaseNo") %></td>
</tr>
</ItemTemplate>
</asp:ListView>
</SelectedItemTemplate>
</asp:ListView>
<asp:SqlDataSource
ID="sdsParent"
runat="server"
ConnectionString="<%&#36; ConnectionStrings:Legal %>"
SelectCommand="SELECT * FROM [tblBankruptcy ]">
</asp:SqlDataSource>
<asp:SqlDataSource
ID="sdsChild"
runat="server"
ConnectionString="<%&#36; ConnectionStrings:Legal %>"
SelectCommand="select * from tblbankruptcyaction where CaseNo = @CaseNo">
<SelectParameters>
<asp:ControlParameter
ControlID="hf1"
Name="CaseNo"/>
</SelectParameters>
</asp:SqlDataSource>

View 2 Replies

Forms Data Controls :: Set The Selectparameter Of Objectdatasource In Usercontrol From Dropdownlist In Parent?

Jan 7, 2010

How do I set the selectparameter of Objectdatasource in usercontrol from dropdownlist in parent page?I tried the following but when I select a new value in the dropdownlist it does not change the data from the initial page load

Protected Sub ODSLocations_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ODSLocations.Selecting
Dim ntid As DropDownList = CType(Me.Parent.FindControl("DDLEmployees"), DropDownList)
e.InputParameters("ntid") = ntid.SelectedValue
End Sub

View 2 Replies

Forms Data Controls :: Assigning ListView.SelectedIndex After Clicking DataPager Control For SelectParameter?

Mar 9, 2011

I'm using a ListView (e.g topListView) with paged rows (using a DataPager). One of the topListView's features is when a user clicks on one of its rows, its SelectedValue property is used to populate a SelectParameter in another SQLDataSource control that populates another ListView (e.g. bottomListView). It's working fine. Even when the webpage first loads, the SelectedValue of first row of the topListView is successfully being used to generate content in the bottomListView.

However, when one of the DataPager's buttons is clicked, the SelectedValue seems to be ignored, and the bottomListView isn't refreshing. And yet, when you click a DataPager button again, it works. basically it's taking TWO clicks of the pager for the SelectedIndex to be read. I've tried assigning the SelectedIndex to 0 in the PagePropertiesChanged and PagePropertiesChanging handlers but no luck (even with calls to bottomListView.DataBind(); and/or SQLDataSource1.DataBind(); after index assignment).

assigning the index seems unecessary though, since top row content is being rendered correctly in a SelectedItemTemplate after clicking any DataPager button. to me that means the SelectedIndex is being set to 0 when the page is being re-rendered.

[Code]....

View 1 Replies

Forms Data Controls :: Value Not Passed From DataList To FormView?

Sep 3, 2010

Can't say I'm new to this, but I just can't see what I'm doing wrong. Can some one please take a look at this and point out why is my Edit event from the DataList not exporting the index value that is needed to populate a FormView? Below is my reduced code.

[Code]....

View 4 Replies

DataSource Controls :: Set Defaultvalue Of Selectparameter With Array?

Feb 6, 2011

I'm working with Linq and I'm using with ObjectDataSource that have SelectParameters tag for inserting default parameters to object.

How can I set <DefaultValue> for an array parameter ?? (i.e : object that have 2 parameters - string and array of int , I can set <DefaultValue> for the string but I don't know how to do it for array)

View 1 Replies

Forms Data Controls :: Updating Fields In A Passed Record From Grid?

Apr 17, 2010

I've got a gridview with three fields, the last of which is a template field with an imagebutton in.

The first field is a Date, and the second is a time field (it is however just varchar field as it may differ and will not be programmatically used).

I want the following to happen if I click on the imagebutton (reserve):

Four other fields must be inserted into the record.

Is the best way to launch a detailsview where the row.imagebutton@=ID and just edit the fields like that or should I pass the two fields (and RecordID) along with the query string to a new page where the passed information can be in invisble textbowes and just have the user enter (UPDATE) the four outstanding fields? I feel like doing it this way?

can read on 1. setting up the onrowcommand code for the templatefield 2.

This should be simple as it is only one table with records that has to be partially inserted by an admin person (2 Fields) and then completed by a web user (4 fields).

View 4 Replies

Forms Data Controls :: How To Call The Bindgrid In Sorting / What Parameter Should Be Passed

Dec 13, 2010

I am using VS 2010.I have a gridview, in which I am binding the gridview from list.

[Code]....

How to call the bindgrid in sorting? What parameter should be passed?

View 5 Replies

Forms Data Controls :: Edited Value Has Not Been Passed To Updateparameter Update Function?

Feb 12, 2010

Below is my aspx

<asp:ObjectDataSource ID="InvitationObject" runat="server" UpdateMethod="EmailUpdate" SelectMethod="ListEmail" TypeName="InvitationDataObject" OnSelecting="InvitationObject_Selecting" > <SelectParameters>

View 3 Replies

DataSource Controls :: Change SelectParameter To Accept Datetime Sql Type?

Sep 21, 2010

If I ran my sproc from query analyzer, I get the correct results(data is filtered by datetime), i.e:

exec Uds.Dashboard_GetJobs '9/20/2010 11:01:23 PM'

However, if I ran it from the Asp.Net page, (ALL records are showed). Looking at the SQL Profiler I see the following call:

exec sp_executesql N'exec Uds.Dashboard_GetJobs',N'@date nvarchar(21)',@date=N'9/20/2010 11:01:23 PM'

Running both statements above in the query analyzer it WILL return me different results. Why? Someone mentioned that it looks like I don't have correct data type specified for SQLParameter in .Net application. I was asked to create something like:

cmd.Parameters.Add("@Date",SqlDbType.DateTime).Value =

Well, my code in the asp.net is in this form:

<asp:SqlDataSource ID="sourceRealtimeLogging" runat="server"
ConnectionString="<%$ ConnectionStrings:UctConnectionString %>"
SelectCommand="exec Uds.Dashboard_GetJobs">
<SelectParameters>
<asp:ControlParameter ControlID="UpdatedTimeUTC" Name="date" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>

So I guess I am passing a string to SQL, not a datetime type. How do I fix this? Not even sure if this is the cause of my issue but worth a try.

View 3 Replies

Forms Data Controls :: Interrogate The RBL And Set The Label So The Correct Value Is Passed Back To The Datasource?

Mar 1, 2011

I have a Gridview with a templated column that gets a True/False value from the SQL Datasource. The value displays as a string in a label in the template. I added a RadioButtonList and in the RowDataBinding event put in some logic to set the appropriate radio button based on the text value of the Label.

Now I want to be able to interrogate the RBL upon update and set the Label text accordingly. I tried the Row_Updating event but that doesn't have a handle on the row itself and the RBL is not in the NewValues or OldValues collection since it's not one of the bound fields. I tried the RBL_SelectedIndexChanged event but I can't get the current row (got a handle on the Gridview but Gridview.SelectRow and Gridview.SelectedDataKey are both null).

how to interrogate the RBL and set the Label so the correct value is passed back to the datasource for update?

View 2 Replies

Data Controls :: Encrypt QueryString Values Passed Directly In Browser

Feb 25, 2013

i  have passed the values from  clientside using querystring. Below link displaying like URL>..i want to encrpyt the following code

?id=vidhansabha&cat_name=Industries&email=rafi045@gmail.com&mobile=9786629228

View 1 Replies

Insert Some SelectParameter In ObjectDataSource Programatic?

Mar 25, 2010

I created a Function called GetWordsLike("word") it look in database to get some words that they are like "word". i also have a TextBox in my page to get "word" from User.

i use ObjectDataSource to databind a gridView and this ObjectDataSource use the GetWordsLike("word") Function to get the data frome database.

now i need to give this "word" to ObjectDataSource programatic.

View 4 Replies

Web Forms :: How To Export CSV Data Passed To Web Method Get Exported Into Excel

Sep 12, 2012

I have comma separated data on client side [Since my columns and rows are dynamic along with dynamic control inside it which are not accessible in backend due to viewstate issue of dynamic controls],

So I am passing CSV string to Web Method as and want to get Excel file out of it.

I tried following code but it is not exporting the file.

[System.Web.Services.WebMethod]
public static void CSV2Excel(string csv){
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=FileName.csv");
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.Write(csv);
HttpContext.Current.Response.End();
}

View 1 Replies

DataSource Controls :: How To Define Stored Procedure For Values Passed In Using Multiple Controls

Jun 4, 2010

I am using 3 web controls ,two are cascading dropdownlists used to filter gridview control bound to a datasource.

My question is , How to define multiple queries in stored procedure that takes parameter values from the controls declared using sqldatasource.Also, return all data when i set default control value to say 'null'.

NB: one paramaterised query for cascading dropdownlists and another for other control.

View 8 Replies

DataSource Controls :: SqlDataSource Returning Nothing When A SelectParamter Value Is Passed To A StoredProcedure?

Jan 14, 2010

- When I execute my query within Enterprise Manager giving the "Country" parameter a value of US, it returns the expected records

- When I assigned that value either programmatically or within the SelectParameters of my SqlDataSource, no rows are returned at all...

I have this as a parameter in the sproc:

@Country char(2) = NULL

and the relevant WHERE clause entry is:

AND (@Country IS NULL OR a.CountryCode = @Country)

My SelectParameter is:

asp:Parameter Name="Country" />

I've tried adding the "DefaultValue" property set to "US" and also tried setting it as sds.SelectParameters[4].DefaultValue="US"

When I do either of these things I get no records returned...

View 2 Replies

DataSource Controls :: Can't Find The Extra Arguments Being Passed To SPROC ?

Mar 18, 2010

I am trying to update a records by calling a SPROC throgh my SQLDataAdapter.Here is my code in this order :

[Code]....

I have looked for parms which are field names with the @ in front but I can't seem to locate them in my code.I could use the assistance of a fresh pair of eyes.

View 2 Replies

DataSource Controls :: Dynamic SelectCommand Won't Be Passed After Partial Page Update?

Mar 11, 2010

I have a page has Listview and Datapager inside UpdatePanel. When I refresh the new SQL results and bind by pressing link buton outside of the update panel, I get correct results. (get new SQLselect statment, rebind to listview, update updatepanel)

However, the SelectCommand is not bound right or some other reason, if I press datapager, I won't get no results.

I'm guessing it's caused by not passing new dynamic selectcommand since my datapager and listview works first update.

View 4 Replies

Web Forms :: The Value Has Not Been Accepted.Its Remaining Null After Passed The Value?

Feb 9, 2011

I have a problem with dll. I have a class library and genrerated a dll. that dll has business entity object.If i pass value from front end t that dll.The value has not been accepted.Its remaining null after i passed the value

View 2 Replies

Web Forms :: Hide Values In URL Being Passed By Hyperlink?

Sep 6, 2010

My gridview has hyperlink field which will redirect to another page when clicked. Is there any way to hide the values from being shown in the URL? I do not wish to have encrypted values as well.

http://localhost:3042/Customer/CustomerDetails.aspx?custid=123456

Any way to show it as

http://localhost:3042/Customer/CustomerDetails.aspx only?

View 6 Replies

Web Forms :: Value Is Passed When Taking Out DirectCast Syntax?

Jul 27, 2010

In my immediate window I get the following:

?DirectCast(Me.FindControl("txtFName"), TextBox).Text.ToString().Trim()
Referenced object has a value of 'Nothing'.
?txtFName.Text
"Lisa"

So .. if I take out the DirectCast syntax, the value is passed but with DirectCast I get the Referenced Object has a value of nothing .. why and do I even need DirectCast here?

View 1 Replies

Web Forms :: Change Color Of A Button If All Validation Is Passed

Mar 11, 2010

Is there a way of checking validation on the fly as the user inputs data and then when all validation is passed - change the submit button to green colour?

View 1 Replies

Web Forms :: Checkbox.checked Value Not Being Passed To Event Handler?

Dec 9, 2010

I have a table with 100 cells in it (10x10)

In each cell there is a checkbox. On page load, each checkbox is checked depending on records 0-99 from a database. This works fine.

However, I want to be able to update those 100 records in the database by checking or unchecking the checkboxes.

The update process works ok as I have debugged it, but the problem seems to be that if I check a checkbox, that value (true or false) doesn't get passed to the event handler.

This is the button click event handler that I'm running right now to see if the value is being recognised:

[Code]....

If I tick checkbox zero and click the button, it still comes up as false. What I want to happen is that the DB is updated and when the page loads, the checkboxes are repopulated with the new values from the database.

View 3 Replies

Bypassing Forms Authentication When A Query String Is Passed

Jan 19, 2010

In ASP.Net, is anyone aware of a way to bypass Forms Authentication if a specific query string parameter is passed in?

Such as:

mydomain.com/myprotectedpage.aspx

...I would like to be protected by Forms Authentication (and so, redirected to login page)

mydomain.com/myprotectedpage.aspx?myBypassParameter=me

...I would like the page to render as normal

View 3 Replies

Web Forms :: Datepicker On Passed Textbox Clientid In Javascript?

Dec 4, 2010

I have a gridview and template field (textbox) control. on GridView_RowDataBound I want to find the control and pass the control id to a javascript which will set datepicker on that textbox here is how I am doing but its not working.

Code behind

----------------

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved