|
Thanks Sathesh, i've understood how this works. Thank you so much.
"My pain is constant and sharp...and i do not hope for better world for anyone. In fact, i want my pain to be inflicted on others..." - Children Of Bodom - Bodom Beach Terror
|
|
|
|
|
Hi all,
Some time before I was struggling with Page break. now I found the method for page break nad still finding to add columns headers after 15 rows.
I am using the following script to set up the page break after printing 15 items in a page. It is working all right. Is there any other way to insert page break after certain page margin?
protected void GVMaterialMovement_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
count++;
if(count > 15)
{
e.Row.Style.Add("page-break-after", "always");
count = 0;
}
}
}
Is there any similar way to add header after each 15 Records?
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi there.
I am uploading images to my website and them writeing it into a DB. I want to do validation on the image that i upload. At the moment i am checking the size(bytes) of the image. what i also need to do, is check the Physical lenght of the image.
Can anyone help me with this?
Thanks
|
|
|
|
|
if(fileUpload1.HasFile == true)
{
blah blah...
}
Hope it helps
|
|
|
|
|
Try this.
<br />
<script runat="server"><br />
Sub submit(Sender as Object, e as EventArgs)<br />
fname.InnerHtml=MyFile.PostedFile.FileName<br />
clength.InnerHtml=MyFile.PostedFile.ContentLength<br />
End Sub<br />
</script><br />
<br />
<html><br />
<body><br />
<br />
<form id="Form1" method="post"<br />
enctype="multipart/form-data" runat="server"><br />
<p><br />
Select file to upload to server:<br />
<input id="MyFile" type="file" size="40" runat="server"> <br />
</p><br />
<p><br />
<input id="Submit1" type="submit" value="Upload!" OnServerclick="submit"<br />
runat="server"><br />
</p><br />
<p><br />
<div id="Div1" runat="server"><br />
FileName: <span id="fname" runat="server"/><br /><br />
ContentLength: <span id="clength" runat="server"/> bytes<br />
</div><br />
</p><br />
</form><br />
<br />
</body><br />
</html> <br />
<br />
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Can any one please tell me how to display messagebox on a button click using a server control.
Thanks in advance
|
|
|
|
|
Use Javascript to Display the Message Box
Regards,
Satips.
|
|
|
|
|
<script language="javascript" type="text/javascript">
function confirmation()
{
return window.confirm("Are sure u want to redirect");
}
</script>
If (Not Page.IsPostBack) Then
Button1.Attributes.Add("onclick", "javascript:return confirmation();")
End If
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("archana.aspx")
End Sub
Sonia Gupta
Soniagupta1@yahoo.co.in
|
|
|
|
|
I am not sure what programming language and what version of .net you are looking for. Here is an example in vb.net for .net 1.1
Private Sub ShowMessageBox(ByVal aMessage As String)
'This procedure will cause a dialog box to pop up with whatever message is passed in.
aMessage = aMessage.Replace(vbCrLf, "\n").Replace("""", "'")
Dim myScript As New StringBuilder
With myScript
.Append("<script>")
.Append(Environment.NewLine)
.Append("alert(""").Append(aMessage).Append(""");")
.Append(Environment.NewLine)
.Append("</script>")
Page.RegisterStartupScript("Promo Error", .ToString())
End With
End Sub
It is slightly different for .net 2.0 and the syntax is a little different for C#.
Hope that helps.
Ben
|
|
|
|
|
Thanks for all ur Replies. I will check your suggestions,
Im using dotnet2005 i.e version2.0 and vb.net as codebehind
|
|
|
|
|
In that case the code is slightly different:
Private Sub ShowMessageBox(ByVal aMessage As String)
'This procedure will cause a dialog box to pop up with whatever message is passed in.
aMessage = aMessage.Replace(vbCrLf, "\n").Replace("""", "'")
Dim myScript As New StringBuilder
With myScript
.Append("<script>")
.Append(Environment.NewLine)
.Append("alert(""").Append(aMessage).Append(""");")
.Append(Environment.NewLine)
.Append("</script>")
ClientScript.RegisterStartupScript(Me.GetType(), "Promo Error", .ToString())
End With
End Sub
Ben
|
|
|
|
|
is there any event that fires up when the web for is closed?
Sonia Gupta
Soniagupta1@yahoo.co.in
|
|
|
|
|
|
Hello Ben......
is there any other way out to check whether the fom is closing...
Sonia Gupta
Soniagupta1@yahoo.co.in
|
|
|
|
|
You can track browser close event
|
|
|
|
|
There are some things you can do with javascript, but nothing works all the time. I would guess you aren't interested in javascript you want something to happen on the server side like expire a session or something like that. There really isn't any good way of doing it. If you do a google search on browser closing event you will see some discussions on this and what other people have tried.
Ben
|
|
|
|
|
You must know the the life cycle of web from . It is stateless so is that possible to close web from . just u close the explore. The last event of web form is dispose. Ok .
Devjit
|
|
|
|
|
|
you can catch that event only using javascript.
All The Best
Sathesh Pandian
|
|
|
|
|
Hi,
Im a bit rusty with .Net so forgive my ignoarance.
I need the easiest (minimal code) way to count the number of records returned by a SqlDataSource (SQL2005). This can be either with a DataSet or a Reader.
Thanks
|
|
|
|
|
|
Hi i am displaying my records in datagrid...,
In that one month data's are displaying with the date...,
Now,Except those dates anyother date will be there in that month...,
It also want to show...,
Example:
june month have 30 days...,
But in my table,i have 1 to 22 date and 25 to 30 date records...,
It will be display using query...,
Remaining 23 to 24 dates also want to show in that datagrid ...,
How to do that...,
Plz tell me...,
-- modified at 7:28 Friday 6th July, 2007
Magesh
|
|
|
|
|
Just u have to write sql query that if the day has no any record that day should have blank record. that will solve your problem.
Devjit
|
|
|
|
|
I hope this time i will get the solution for this probs...,
I am trying to display my datagrid bound column cell value in datagrid textbox place...,
So i used this following code...,
For Each fillgrdregtextbox As DataGridItem In dgrdmain1.Items
Dim AppRgHrs As TextBox = CType(fillgrdregtextbox.FindControl("txtAppRgHrs"), TextBox)
Dim AppOtHrs As TextBox = CType(fillgrdregtextbox.FindControl("txtAppOtHrs"), TextBox)
If fillgrdregtextbox.Cells(25).Text <> "" Then
AppRgHrs.Text = Val(fillgrdregtextbox.Cells(25).Text)
AppOtHrs.Text = Val(fillgrdregtextbox.Cells(26).Text)
ElseIf fillgrdregtextbox.Cells(27).Text <> "" Then
AppRgHrs.Text = Val(fillgrdregtextbox.Cells(27).Text)
AppOtHrs.Text = Val(fillgrdregtextbox.Cells(28).Text)Else
AppRgHrs.Text = 0
AppOtHrs.Text = 0
End If
Next
In this that first if condition is working...,
But that elseif is not working...,
Instead of that i am getting 0 on there...,
If its not possible plz tell me some other way to do that...,
Advance thanks...,
-- modified at 7:24 Friday 6th July, 2007
-- modified at 7:25 Friday 6th July, 2007
Regards,
Magi
|
|
|
|
|
please correct your subject
Regards,
Satips.
|
|
|
|