|
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?
|
|
|
|
|
There is now a pagersetting object/property that has the top and bottom settings in the position property.
Ben
|
|
|
|
|
Hi,
I would like to know how i can perform update or delete by using Update method of sql data adapter. I have done the insert operation using update method. The code follows...
<br />
public Boolean SetStorageArea(int UID, DataTable dtStorageArea)<br />
{<br />
string strSql;<br />
strSql = "SELECT [Active],[WarehouseID],[StorageAreaID],[StorageAreaShortName],[StorageAreaName], " +<br />
" [Alias],[Notes],[CreatedBy],[CreatedOn],[LastModifiedBy],[LastModifiedOn] FROM [StorageArea]";<br />
try<br />
{<br />
DataSet dsStorageArea = new DataSet();<br />
dsStorageArea.Tables.Add(dtStorageArea);<br />
SqlDataAdapter sda = new SqlDataAdapter(strSql, sqlcon);<br />
SqlCommandBuilder sqb = new SqlCommandBuilder(sda);<br />
sda.Update(dsStorageArea, "StorageArea");<br />
return true;<br />
<br />
}<br />
catch (Exception Ex)<br />
{<br />
<br />
throw new Exception("SetStorageArea: Could not get the records of all Storage Areas.\nOriginal message: " + Ex.Message);<br />
}<br />
}<br />
.
awaiting for your valuable suggestions..
Thanks in advance
Sebastian
|
|
|
|
|
Hi Sebastian ,
I never used command builder ..i use sqlcommand object..check if it works for u ...
SqlCommand updatecmd = new SqlCommand(strSql, sqlcon);
SqlCommand deletecmd = new SqlCommand(strSql1, sqlcon);
SqlCommand insertcmd = new SqlCommand(strSql2, sqlcon);
SqlDataAdapter sda = new SqlDataAdapter();
sda.UpdateCommand = updatecmd; //here cmd generater for update
sda.DeleteCommand = deletecmd; //here cmd generater for delete
sda.InsertCommand = insertcmd ; //here cmd generater for insert
sda.Update(dsStorageArea, "StorageArea");
pallavi
|
|
|
|
|
Hi Pallavi,
Thank you very much. This method will work, the only thing is i have to avoid command builder...
Thanks once again
Sebastian
|
|
|
|
|
Hi,
I have designed a registration form using wizard control in asp.net2.0. it consists of 5 steps.
In steps 1, 2 and 4 there are some mandatory fields where the user has to fill. I kept some validations for that in those steps.
My Issue:
How can i make sure(reconfirm) in 5th step that the user has filled all the required fields in previous steps.
Please let me know your suggestions.
Many Thanks!!
Jagadeesh
|
|
|
|
|
Dear jagadeesh,
use validators like requiredfield validator etc..
then in the page_load you can check it through
page.Isvalid.
If you want to check them means use some validation summary to view the
errors otherwise use javascript for validating the data.
All The Best
Sathesh Pandian
|
|
|
|
|
Hello Sathesh Pandian,
Page.IsValid doesn't work in wizard control's finish button click event.
To be more clearer on the question i mentioned above 5 steps which means 5 different wizard pages, but not 5 input fields.
In the 5 wizard pages I kept some validations in pages 1, 2 and 4 along with validation summary controls in those three pages.
My Issue:
How can i make sure(reconfirm) in 5th step that the user has filled all the required fields in previous wizard control pages.
Please let me know how to resolve this issue.
Many Thanks!!
Jagadeesh
|
|
|
|
|
Hi i have one datagrid in that i have my dropdownlistbox...,
When i am loading some datas in my datagrid...,
Based on that data,my dropdown box data also want to display...,
Example:
if i load an employee id in that datagrid..,
Based on that employee id, his/her name want to display in that dropdown list box...,
How to do that?,
Plz help me...,
Regards,
Magi
|
|
|
|
|
Hi Magi,
consider one example. If my dropdown list have datasource which conatin employee id and employee name. your display field will be employee name and value field will be employee id. so if your datagrid is having datasource in which it contains employee id column.
it will show respective name in dropdown list column...
pallavi
|
|
|
|
|
how can I add mailed-by header to mailmessage object???
I am using
newMail.Headers.Add("Mailed-By","rebuscode.com");
but it is not showing mailed by in the header of the mail recieved by user.
hiiiiii
hiiiiii
|
|
|
|
|
Don't Repost.
Regards,
Satips.
|
|
|
|