|
you can test whether the value is Null before setting the SelectedValue. you can test against System.DBNull.Value
|
|
|
|
|
how can u do that?
In dataSource?
aj123
|
|
|
|
|
I am not a big fan of datasource controls but thats another discussion.You can bind the SelectedValue to a function that takes the value as parameter and test for NULL in it, or you can wire up the ondatabound event...
|
|
|
|
|
Hi friends
In my Update Panel I have one gridview in which I bind three textboxes and three required field validator in ItemTemplate.
I have one button which is placed out of update panel.
On page load event i bind only one row of gridview.
Now i have one link button.
When i click on link button,new row of grid view will be added.
Now my problem is that when I click on Button then requiredfield validators fires only first three textboxes of first row.
They are not fire for adding new rows textboxes.
Can anybody give me right suggestion for this?
Thanks in advance
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi Guys,
Can you provide me with xml reference / snippet where it could read, then parse the xml, I tried looking around on the articles but I find them more advance.
Thanks
Dom
|
|
|
|
|
|
Thanks Fred, the site works great for me
Dom
|
|
|
|
|
I am developing a attendance application where I need to generate the report.I have planned to use Crystal reports.
Now my requirement is:
1)I need to create a dataset where I need to have fields from three different database-tables.How to do that?Is that possible?
2)I need to print a column for Present,Absent,Holiday.
3)binding the dataset with the crystal reports.
kindly help me on doing this...
Thanks in advance.
Happy Programming!!!
|
|
|
|
|
Hello Everybody
I am doing a project name Help Desk. On my gridview there is a Button and some Templated Field. I put a CheckBox on Item Template. When you click the Button then another page will be come ( about who will help you), when you finished fill up that form then I want see that particular rows CheckBox is ticked (make sure some one is going to you help you).
Any help will be greatful for me. Waiting for your reply
Sarfarj Ahmed
|
|
|
|
|
hi all
so I thought WCF could call web services too. Is this true?
or is it either WCF OR Web services?
if you CAN call a web service through WCF, how would you
configure its <endpoint>?
I have this all configured and my WS is running, & my proxy
instantiates fine too (meaning it doesnt return null), but when I make
a call to a method in my WS. it says "Object reference set to null".
Or do I have to create a different proxy for the web service? is
that the difference between WCF & WS?
thanks in advance!
Moazzam
-- modified at 3:30 Saturday 30th June, 2007
|
|
|
|
|
For an asp.net application, I'm using an xml file to read in configuration settings. The problem is... some of the settings can hold sensitive data. I want to ensure that the application can read in the values, but that the server will not acknowledge any http requests on the file. Prior programming conventions would dictate placing the configuration file somewhere outside of the scope of the web root, but that makes for more difficult installations... I'm trying to keep the whole application limited to one directory.
So... is there a web.config setting I could use to grant server access to a file, but not http access?
|
|
|
|
|
You can use the location element in ASP.NET 2.0 (not sure about previous versions) MSDN[^]
|
|
|
|
|
Thanks a lot; knowing this is definitely a big piece of the puzzle, as it will surely be how I target the specific file. But I'm still unsure of the specific configuration that will instruct IIS to reject http requests for that file, while still allowing server requests.
-Roo
|
|
|
|
|
Try this:
<code>
<location path="YOUR_FILE_NAME.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</code>
|
|
|
|
|
How can I find the row index when a linkbutton is clicked within a grid?
<asp:TemplateField HeaderText="BName" SortExpression="strBName">
<EditItemTemplate> </EditItemTemplate>
<ControlStyle CssClass="grid" />
<ItemStyle CssClass="grid_row_left" HorizontalAlign="Left" Font-Bold="False" />
<HeaderStyle HorizontalAlign="Left" />
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" Text='<%# Eval("strBName") %>'></asp:LinkButton><br />
</ItemTemplate>
</asp:TemplateField>
Private Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
e.CommandArgument does not give me the row index.
Thanks,
Martin
|
|
|
|
|
Microsoft help suggest setting it in the row create:
Sub CustomersGridView_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
' The GridViewCommandEventArgs class does not contain a
' property that indicates which row's command button was
' clicked. To identify which row's button was clicked, use
' the button's CommandArgument property by setting it to the
' row's index.
If e.Row.RowType = DataControlRowType.DataRow Then
' Retrieve the LinkButton control from the first column.
Dim addButton As LinkButton = CType(e.Row.Cells(0).Controls(0), LinkButton)
' Set the LinkButton's CommandArgument property with the
' row's index.
addButton.CommandArgument = e.Row.RowIndex.ToString()
End If
End Sub
Hope that helps
Ben
|
|
|
|
|
It did.
Once again, thank you Ben.
|
|
|
|
|
|
unable to set connectionstring property of Sqldatasource used with gridView dynamically in asp.net 2.0 using c#
after using it
getting Exception :The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty.
in syntax <%$ConnectionStrings:ConnectionString%>
I'm thinking string after : is the key used in web.config file is it correct?
Please guide what is gone wrong?
following is the code snippet:
<asp:sqldatasource id="SqlDataSourceCat" runat="server" connectionstring="<%$ConnectionStrings:ConnectionString%>" updatecommand="UPDATE DXCategory SET CategoryName =@CategoryName Where CategoryId=@CategoryId" selectcommand="SELECT [CategoryID], [CategoryName] FROM [DXCategory] order by CategoryId desc">
<updateparameters>
<asp:parameter name="CategoryName">
<asp:parameter name="CategoryID">
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Does your web.config have a ConnectionString with the name 'ConnectionString'? Because the code you provided (though only visible in html source) assumes so.
|
|
|
|
|
thank you Szukuro for reply.
Yes, web.config have a ConnectionString with the name 'ConnectionString' set as key name .
now i tried with another syntax as follows in aspx page
ConnectionString="ConnectionStrings:ConnectionString"
This is not giving exception but dat is not getting bound to the repeater.
Please guide.
Thank you.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Does anyone know where I can find this property of the new GridView control
<PagerStyle Position="TopAndBottom"
It tells the control where to put it's paging numbers.
Thanks
|
|
|
|
|
You will need to re-post with the Ignore HTML tags check box checked. Can't see what property you are asking about. Paging does work differently in a gridview, especially if you are using a sqldatasource or an objectdatasource.
Ben
|
|
|
|
|
you have to use VS 2005 and asp.net 2.0.
Gridview controls are not come free with any package.
All The Best
Sathesh Pandian
|
|
|
|
|
Sorry the tag disspeared. It was the property that puts the pager at the bottom and the top of the results. At the moment, be default it is at the bottom. I want it to be at the top and the bottom of the results. Any ideas cos i cant find the property?
|
|
|
|