|
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
|
|
|
|
|
i am building a image gallery in ASP.NET. All images are placed in a specific folder and i want to show the thumb nails of all those image on the web page. Its all working well. Means that my page is displaying the thumb nails of all images that exists in the folder.
The problem arise when i copy the new files in the folder, then the new copied files are not being displayed by thumbs.db file. Thumbs.db file donot update itself when new files are copied in the folder.
how i can solve this problem that when ever i delete or copy images in the folder, the thumbs.db file updates itself???????????????
-<>-shoaib-<>-
|
|
|
|
|
Don't cross post, but to answer your question, I believe you will need to write your own thumbnail generator.
Luckly for you, here's one I already done :-
Create a new Web Form and call it Thumbnail.aspx
Put the following code in the code behind
Partial Class Thumbnail<br />
Inherits System.Web.UI.Page<br />
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
Try<br />
Dim oImage As System.Drawing.Image<br />
Dim oThumbnail As System.Drawing.Image<br />
Dim sServerPath As String<br />
Dim sFileName As String<br />
Dim iWidth As Int16<br />
Dim iHeight As Int16<br />
<br />
sServerPath = AppPath() & Request.QueryString("p")<br />
sFileName = Request.QueryString("f")<br />
Try<br />
oImage = System.Drawing.Image.FromFile(sFileName)<br />
Catch ex As Exception<br />
oImage = System.Drawing.Image.FromFile(AppPath() & "Images\error.gif")<br />
End Try<br />
<br />
If Request.QueryString("w") = Nothing And Request.QueryString("h") Is Nothing Then<br />
iWidth = oImage.Width<br />
iHeight = oImage.Height<br />
ElseIf Not Request.QueryString("w") Is Nothing And Not Request.QueryString("h") Is Nothing Then<br />
iWidth = Request.QueryString("w")<br />
iHeight = Request.QueryString("h")<br />
ElseIf Not Request.QueryString("w") Is Nothing Then<br />
iWidth = Request.QueryString("w")<br />
iHeight = oImage.Height / (oImage.Width / iWidth)<br />
ElseIf Not Request.QueryString("h") Is Nothing Then<br />
iWidth = oImage.Width / (oImage.Height / iHeight)<br />
End If<br />
<br />
oThumbnail = oImage.GetThumbnailImage(iWidth, iHeight, Nothing, System.IntPtr.Zero)<br />
Response.ContentType = "image/jpeg"<br />
oThumbnail.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)<br />
oImage.Dispose()<br />
oThumbnail.Dispose()<br />
Catch ex As System.Exception<br />
'Your error handling here<br />
End Try<br />
End Sub<br />
End Class
To use the Thumbnail.aspx simply call into from the webpage you wish the thumbnail to appear like so :-
<img src="Thumbnail.aspx?w=100&f=myimage.jpg">
The w parameter represents the width of the thumbnail, you call also use a h parameter for the height or combine the two. The f parameter is path to the image.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|