|
Hi
I have already gone through that link and make the changes in web.config file as i mentioned in thread. Do i need to change any other changes in code for this one?
Thanks
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Yes, Microsoft wrote an article on what you need to do, but they left stuff out, just to make it hard. What makes you think that what Microsoft told you to do in that article is not enough ? Do you have a specific issue ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
In my application i had headings in between the grid rows when i export the grid to excel the headings were not displayed i used the code like this
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
htmlWrite.WriteLine("<b><font size=5 color=red>" + Heading.ToString() + "</font></b> <b><font size=4 color=blue>TDP IT-Department</font></b>");
//System.Web.UI.WebControls.DataGrid dg = new System.Web.UI.WebControls.DataGrid();
//dg.DataSource = dv.Table;
//dg.DataBind();
gv.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
help me out to solve this
|
|
|
|
|
Not shown at all, or just not styled ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
not shown at all an empty row is being displayed
i used the code like this to add a row to grid
DataTable dt1 = dv1.ToTable(true, "nDepartmentID", "sDepartmentName");
int i = 2;
// Session["i"] = ds.Tables[0].DefaultView;
for (int m = 0; m <= dt1.Rows.Count - 1; m++)// foreach (DataRow dr in dt1.Rows)
{
DataTable dt = dv1.ToTable("dt", false);
object objCount = dt.Compute("count(nDepartmentID)", "nDepartmentID in (" + int.Parse(dt1.Rows[m]["nDepartmentID"].ToString()) + ")");
if (dt.Rows.Count > 0)
{
GridViewRow gvRow = new GridViewRow(i, 0, DataControlRowType.DataRow, DataControlRowState.Insert);
TableCell tblCell = new TableCell();
//Add Summary Row
tblCell.Text = dt1.Rows[m]["sDepartmentName"].ToString();
tblCell.ColumnSpan = 6;
tblCell.BorderWidth = 2;
tblCell.HorizontalAlign = HorizontalAlign.Left;
tblCell.ForeColor = System.Drawing.Color.Red;
tblCell.Font.Bold = true;
tblCell.Font.Size = 12;
gvRow.Cells.Add(tblCell);
gridView.Controls[0].Controls.AddAt(i, gvRow);
i = i + int.Parse(objCount.ToString()) + 1;
}
}
|
|
|
|
|
use this code.
Dim attachment As String = "attachment; filename=MyFile.xls"
Response.ClearContent()
Response.AddHeader("content-disposition", attachment)
Response.ContentType = "application/ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
Dim frm As New HtmlForm()
GridViewEmployeeRegistrationDetails.Parent.Controls.Add(frm)
frm.Attributes("runat") = "server"
frm.Controls.Add(GridViewEmployeeRegistrationDetails)
frm.RenderControl(htw)
Response.Write(sw.ToString())
Response.End()
Thanks and Regards
Sujit Kr. Mandal
|
|
|
|
|
Dear all, Thank you. I have made it.
modified on Thursday, October 8, 2009 3:37 AM
|
|
|
|
|
Yonathan1111 wrote: Forum: ASP.NET
Subject: TableInsideTableRow [modified]
Sender: Yonathan1111
Date: Thursday, October 8, 2009 1:21 PM
Dear all, Thank you. I have made it.
|
|
|
|
|
what u hv made??????????
Thanks and Regards
Sujit Kr. Mandal
|
|
|
|
|
Hello Sujit Kr.Mandal. I have made a Table that contains for another table inside one of its row. This can help to have a good layout of controls on the displayable page. The page is done with ASP.Net.
|
|
|
|
|
Hii,
I have been using session variables to maintain the session of a particular user accessing the application.
And on logout, i clear out all sessions and redirect it to login page.
But it doesn't work, since with the help of a browsers back button u can still perform all operations on the appication.
I would like to know the best possible solution for logout functionality.
A user after logout should not be able to access the app even through browsers back button.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
Hi ,
Are you able to preform operation if you go to the page by browser back button even after logout.If yes,it shows that you have not check whether the session expires in each page.
|
|
|
|
|
Could you please elaborate on how can i check for session expiration.
I used to check for session.IsNewSession on each page.
But even that couldn't help,
hence would like to know how can i implement session expiration in every page.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
Your login should be stored in the session. You don't need to write some code to expire the session in every page, just set the value you check to null, when someone logs out.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Check the session variable is not null in page load of each pages.If null redirect to login page.It will avoid you to perform operations.
|
|
|
|
|
Vishnu Nath wrote: Could you please elaborate on how can i check for session expiration.
I used to check for session.IsNewSession on each page.
if(Session["UserID"] != null)
{
}
else
{
Response.Redirect("Login.aspx");
}
|
|
|
|
|
Abhijit Jana wrote: if(Session["UserID"] != null)
{
//Do Operation
}
else
{
Response.Redirect("Login.aspx");
}
This is only valid if a session for that variable was created and you are checking for its value.
But if someone requests this page directly, it will throw an error stating
Object refrence not set.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
|
Buy a really basic book and read it. The code is CHECKING if the value is null.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanx for your suggestion and advice,
will surely do the same.
I have implemented my own logic on it.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
What logic u applied.Beacuse back button take page from cache.so it take old session value.
so to avoid this wat u did?
I also want to know
|
|
|
|
|
U r right.
And to stop a user accessing a page even after logout, i simply disabled the browsers back button after logout through javascript.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
U means u disable ur back button in ur whole project.
|
|
|
|
|
What was the Wrong with CG's Answer ?
|
|
|
|
|
No he wasn't wrong.
I had a bit concern, if a user tries to access the page directly, without following the normal routine, then the session variable which i would be checking on my page, would never have existed.
Hence i put out a check over there nd followed with the rest of the suggestions provided by all of u.
Aspiring Techie,
Vishnu Nath
|
|
|
|