|
Well it will do - it will run once for every row in your datagrid, as each row is created (or bound to the data) - that's what these events are; that's why theya re called what they are.
What you are trying to do is attach the appropriate javascript to each button, one on each row, so you want it run over and over like that! All you need to do is fugure out the right code to do it.
You are on the right tracks, but it's hard ot know exactly where you;re going wrong... there are lots of examples on the web about how to do the sort of thig you want. Type "datagrid delete confirm" into Google... or try this site:
http://www.datagridgirl.com/[^]
or this
http://www.4guysfromrolla.com/[^]
both have loads of great tutorials and examples....
Fred
|
|
|
|
|
HI
i want to execute some code after focus move from textbox.is there any
event available similier to onblur event for html textbox
for asp:textbox.
And one more thing when the Keypress
event is executed.(this event is of html textbox).which of the event first
occur
---textchanged event
------keypress event
df
|
|
|
|
|
I use the onblur event for asp textboxes.
<asp:TextBox TabIndex="4" ID="tbCallersName" runat="server" MaxLength="50" onblur="javascript:toUser_LostFocus(this);" Width="197px"></asp:TextBox>
Example I just copied and pasted from my code
hope this helps
Cheers
Cads
|
|
|
|
|
Hi Senseicads
but the function i have called on onblur event is a server side
function not defined in javascript.How can i call this.
thanks.
df
|
|
|
|
|
Just stick the method inside some serverside tags.
onblur="<% methodname() %>"
|
|
|
|
|
HI Senseicads
It gives syntax error.
Thanks.
df
|
|
|
|
|
Sorry my fault
Wrote it with a typo! missed off an '='
<%= method() %>
if you can't get it to do what you need here, and you have Ajax installed you can always try using pagemethods.
Cheers
Ian
|
|
|
|
|
Thanks for u r valuable rply but still it give syntax error.
Thanks,
df
|
|
|
|
|
Hi All,
I have this reqular expression for Date Validation i-e (dd/MM/yyyy)
/(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/
It works fine, But there is a problem, i-e if I give 29/02/2007 then it will not validate date and code will give error. Cuz Feb is of 28, similarly same problems for other months like April is of 30. If I give 31 it will not validate Date and my code will give error.
Any help regarding to this.
Thanks in Advance.
|
|
|
|
|
You have to Validate your date for the Year depending upon the Months and the year.
Regards,
Satips.
|
|
|
|
|
Ya Dear I know but can u give me any help regarding to that. Can u give me any regular expression for that.
|
|
|
|
|
For Date Validation
Use this Code
("([0-3]{0,1}[0-9])" +"(? :/([01]{0,1}[0-9])/)" + "|(?:\\-([01]{0,1}[0-9])\\-))" + "((?:19|20)[0-9]{2})");
Regards,
Satips.
|
|
|
|
|
|
Check now i have Changed the code.
Regards,
Satips.
|
|
|
|
|
It is also not working dear.
|
|
|
|
|
|
Trying to run my app. in VS 2005 and keep getting this error message:
"This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory"
Anyone any ideas how to solve this problem or what it is.
I cannot find app_offline.htm.
macca
|
|
|
|
|
there is one main reason for this error which i have faced
when your IIS Server is down VS.Net2005 Framework would automatically add a file called app_offline.htm
Remove this file and then restart your IIS and then try.
there might be some other error which would be coming but since IIS is down and framework doesnot get any response. it adds the page app_offline.htm and start showing instead of the actual error.
Regards,
Satips.
|
|
|
|
|
Thanks for replying Satips but where do I find this app_offline.htm file in order to remove it?
macca
|
|
|
|
|
macca24 wrote: where do I find this app_offline.htm file
In your web application directory
|
|
|
|
|
I know that, but it is not there.
Is there a specific place in the web root directory becasue I cannot see it.
macca
|
|
|
|
|
It will be in the root folder.
Regards,
Satips.
|
|
|
|
|
Hi all,
How can we change the value of a BoundField of Gridview like I have password field in table user_Information and I am storing password in encrypted form. My problem is that when I use following format, the Password field show those password in Encrypted form(i.e. stored in table) but I want to show them in decrypted form. I don't know whether it is possible or not, if yes please let me know. I am using AccessDatasource object to bind the GridView.
Thanks in advance.....
<code>
<asp:GridView ID="GVUser" runat="server" Width="976px" AutoGenerateColumns="False" CellPadding="1" ForeColor="#333333" AllowPaging="True" AllowSorting="True" CellSpacing="1" Font-Names="Arial" Font-Size="9pt" HorizontalAlign="Left" ToolTip='"Rack Master"' OnPageIndexChanging="GVUser_PageIndexChanging" OnSelectedIndexChanging="GVUser_SelectedIndexChanging" OnSorting="GVUser_Sorting" DataKeyNames="User_ID" DataSourceID="AccessDataSource1" >
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="User_ID" HeaderText="ID" ReadOnly="True" SortExpression="User_ID" />
<asp:BoundField DataField="User_Name" HeaderText="Name" SortExpression="User_Name" />
<asp:BoundField DataField="Designation" HeaderText="Designation" SortExpression="Designation" />
<asp:BoundField DataField="Fathername" HeaderText="Father's Name" SortExpression="Fathername" />
<asp:BoundField DataField="DOB" HeaderText="D.O.B." SortExpression="DOB" DataFormatString="{0:dd-MMM-yyyy}" HtmlEncode="False">
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="Identity_Mark" HeaderText="Identity Mark" SortExpression="Identity_Mark" />
<asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="User_Password" HeaderText="Password" SortExpression="User_Password" HtmlEncode="False" />
<asp:BoundField DataField="Rights" HeaderText="Rights" SortExpression="Rights" />
<asp:BoundField DataField="bajrang" HeaderText="bajrang" SortExpression="" />
<asp:CommandField ButtonType="Image" SelectImageUrl="~/images/icon-edit.gif" ShowSelectButton="True" />
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" BorderStyle="Ridge" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
</asp:GridView></code>
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
I'm not sure that I understood correctly, but I suggest using the DataRowBound event of the GridView and replace the values you want.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I would convert the boundfield for the password to a template field. something like this:
<asp:TemplateField SortExpression="User_Password">
<ItemTemplate>
<asp:Label ID="lbPassword" runat="server" Text='<%# DecryptPassword(DataBinder.Eval(Container.DataItem,"User_Password")) %>'></asp:Label>
Then make sure your method to DecryptPassword is public so the DataBind can call it.
I haven't actually tried to do this, but I think the code above will work.
Hope that helps.
Ben
|
|
|
|