|
How to get the India time zone with asp
Kumar.a
email : akumar8_k@yahoo.com
info@livecriket2007.com
|
|
|
|
|
|
asp.net 2.0,ATLAS and XAML must i unit in one application.
how can merge this in one appliaction?
i am making presentation of component parts ASP.NET,ATLAS and XAML.
Have anyone any idea,what a application let i develop ?
i would be grateful,for any exampel or idea?
danks,
M
|
|
|
|
|
i am having the grid which displays some table content,
how to take printout of the whole datagrid content with the same format.
Help me.
abul
|
|
|
|
|
make this function in your .aspx.cs file
public static void PrintWebControl(Control ctrl)
{
PrintWebControl(ctrl, string.Empty);
}
public static void PrintWebControl(Control ctrl, string Script)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
if (ctrl is WebControl)
{
Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
}
Page pg = new Page();
pg.EnableEventValidation = false;
if (Script != string.Empty)
{
pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
}
HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");
frm.Controls.Add(ctrl);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);
string strHTML = stringWrite.ToString();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strHTML);
HttpContext.Current.Response.Write("<script>window.print();</script>");
HttpContext.Current.Response.End();
}
and then on button_click event write like following
protected void printreport_Click(object sender, EventArgs e)
{
PrintWebControl(gvAnualReport);
}
|
|
|
|
|
may i know the diff b/w view state and hidden fields
|
|
|
|
|
view state is the property of asp.net's pages and controls which can be enabled or disabled but is enable by default. The purpose of enabling view state is to maintain the user's input on controls after the post back which was not available in ASP's post backs. In ASP when page is post back all the inputs on form are lost and we need to enter all the values or input again but its not the case with ASP.NET after the post back all the user input or values remain on the form and are not lost.
Hidden field is a simple input control put is hidden. Suppose if u dont want to show user some values dat you may be using in ur client side scripting then u can store these values in hidden fields and can get using javascript
|
|
|
|
|
Yeah, that's absolutely correct...but just to emphasize the main point here, view state IS one of the three hidden fields available in ASP.Net.
sam
|
|
|
|
|
In my application css file for page is genrating at run time .
Now when i made some changes old file is get deleted and new file is created.
Problem is that css which is getting applied on page is previous one as it get
stored on client machine in Temporary Internet Files.
Name of file has to be same otherwise useless files will get stored on server.
How can i apply newly genrated css file which is stored on server.
Thanks in advance.
|
|
|
|
|
Add a random parameter to the url:
MyStyle.css?t=9838459873645
That will make the url unique each time and load the file from the server every time.
This of course removes any advantage of having a css file in the first place, so you can just as well put the style in the page instead.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks,
But i can't use response.redirect.
|
|
|
|
|
What was it in my post that did make you think that you should use Response.Redirect?
---
b { font-weight: normal; }
|
|
|
|
|
how to write the code for sending image with message
|
|
|
|
|
|
|
|
i have a datagrid that i want create the column of datagrid myself. i write this code but its not right in visual studio 2005 how can i do this work?
BoundColumn dgColStord = new BoundColumn();
dgColStord.HeaderText = dsHeader.Tables[0].Rows[i]["stord_desc"].ToString();
dgColStord.DataField = i.ToString();
dgColStord.Columns.Add(dgColStord);
the last line is not right it give error for columns.
|
|
|
|
|
check that what is the value of i? coz i's value shd be the name of column in the datasource whose value will be set in the bound column
why dont u try using a template column and sets the value in that columns coz bound column always requires a column name in the DataField here in ur code i seems to be an index
|
|
|
|
|
Hi,
I am using a Master page for a child page that requires do Client-side data validation using Javascript. The function in Javascript need to take the form as argument, so it can access all the controls within the form. The javascript is registered in the child page. When I tried to pass the form argument into javascript funciton, it alway fails. If I do it without using master page, it works fine. Is there anything particular I need to take care when using a master page for a child page which contains client-side validation?
Here is how the code I used:
<asp:button id="btnSubmit" runat="server" text="onClick" onclientclick="return DataValidation(Form1)">
Can anybody give me some hint about what I do wrong? Thanks in advance!
|
|
|
|
|
why dont u use something like this:
...="return DataValidation('Form1')"
|
|
|
|
|
I did try to pass 'Form1'.. but it doesn't work either.
|
|
|
|
|
Hi Vicky!
That approach dowsn't work because during page rendering (i.e. result page from server to client) the names of controls change IF you have created a nested environment. For example, if you have a master page that has ContentPlaceHolder1, and one nested child page displayed through that ContentPlaceHolder1 with a text box control and a button (with their default names) this would be rendered with these id's:
ctl00_ContentPlaceHolder1_TextBox1 (instead of TextBox1)
ctl00_ContentPlaceHolder1_Button1 (instead of Button1)
If you have a nested master page, then the controls would have these id's:
ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder1_TextBox1 (instead of TextBox1)
ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder1_Button1 (instead of Button1)
You can pass those control id's to your javascript, it should work. However, there are other ways of 'programmatically' retrieving the server control's id, but that requires interfacing with ICallbackEventHandler and yada yada yada... I find it best to keep things simple
BTW Vicky, I couldn't see your code! Can you paste it once more so maybe I could be more specific in my answer?
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
Hi Nila,
Here is the code I used when calling the JavaScript function:
<asp:button id="btnSubmit" runat="server" text="onClick" onclientclick="return DataValidation(Form1)">
Would you mind to refer me more information about ICallbackEventHandler? Anyway, I will try the approach of passing control id.
Thank you very much for your help!
|
|
|
|
|
<asp:button id="btnSubmit" runat="server" text="onClick" onclientclick="return DataValidation(Form1)">
|
|
|
|
|
It seems that the forum doesn't take some special characters. Let me try again :
This is the button control :
.... ID="btnSubmit" runat="server" Text="onClick" onclientclick="return DataValidation(Form1)" ....
|
|
|
|