|
Christian Graus wrote: Have you done any sort of debugging ? What have you found ?
Why don't you use descriptive variable names ?
I have found nothing.. I forgot to present my exact problem: if I run with the code in first post, and I try to sort, it happens nothing. With the "solution" of my second post, when I sort the Gridview disappears.
What is exactly descriptive variable names? Can you give an example?
Rather Use
DataView dataView = dataTable.DefaultView
Maxdd 7 wrote:
Session["data"] = dt;
Why do you need Session to store datatable. .. D'Oh! D'Oh! D'Oh!
Also what exactly the problem is? Check Page_Load, if you have set DataSource and DataBind for every page postback.. You should filter out using if(IsPostBack)
Yes, in fact Session["data"] its nothing
My temp table is loaded this way:
if (!Page.IsPostback)
TempTable();
So I suppose I set DataSource and Databind just one time.. but its strange because if I do if(Page.Ispostback) my gridview does not appears...
Your advice, DataView dataView = dataTable.DefaultView, should I apply it in the code of my first post ( DataTable dataTable = GridView3.DataSource as DataTable; ) or the second one ? (DataTable dataTable = Temp as DataTable;) I tried with both but the problem still exists.. (first does not happen nothing, second disappear
Dont know else to do...
Thanks for your help!
modified on Tuesday, November 24, 2009 4:50 PM
|
|
|
|
|
Maxdd 7 wrote: What is exactly descriptive variable names? Can you give an example?
reportList as opposed to listView1.
Maxdd 7 wrote: So I suppose I set DataSource and Databind just one time.. but its strange because if I do if(Page.Ispostback) my gridview does not appears...
Are you using viewstate, or is it turned off ?
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.
|
|
|
|
|
Christian Graus wrote: Are you using viewstate, or is it turned off ?
public DataTable Temp
{
get
{
object o = ViewState["Temp"];
if (o == null)
{
DataTable dt = new DataTable();
return dt;
}
else
return (DataTable)o;
}
set
{
ViewState["Temp"] = value;
}
}
Have I answered to your question? If not I'll try again.
|
|
|
|
|
This doesn't tell me if viewstate is turned on for the page or not. Have you set breakpoints to see if your data here is persisted or if it's lost ?
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.
|
|
|
|
|
Christian Graus wrote: Have you set breakpoints to see if your data here is persisted or if it's lost ?
Could you recommend where to set breakpoints?
I am not doing breakpoints but I'm using Response.write in many places to know where of there's any data not executed. But I think I know the problem: with the solution in my second post (after sort grid disappears), looks like cant sort temporary table... maybe I should use another temp table ?
|
|
|
|
|
|
I have N number of applications which sends emails.
All the failed emails are collected in a folder.
My job is to read all the failed mails from folder and find which application sent it.
How can we do this.
cheers
chandu
|
|
|
|
|
Your JOB is to do this ? Do the programs use a unique FROM address to show where they came from ? If not, you should talk to your boss, and tell him that he is an idiot for giving you an impossible job. Unless it's april fools day ?
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.
|
|
|
|
|
|
asp site which needs to be migrated to asp.net.
I've been provided part of the classic asp site with asp pages which needs to be migrated to asp.net. There are include files on these pages which are not given to me. Am confused how to progress.
Till now, I created a asp.net weaplication and added all the aspfiles into it and had then renamed as filename.aspx. The solution builds but cannot(obviously !!) run it as include files are not part of my local solution. Am confused how to progress here. As obviously renaming is not what I should end with. I need to rewrite it , is my gues. But how do I progress with just a part of site (which obviously has references to other pages on site).
|
|
|
|
|
You can't do a partial migration. It is just not possible. Include files have to be there. Especially as you will want to replace them with asp.net server controls. I suggest you go back to your client and tell them you can't proceed without the full original source for the site.
|
|
|
|
|
Well FEMDEV,
If you want to build a proper and good asp.net site from ASP, just recollect all the basic logic around the codes available for asp site and rewrite the whole thing.
There are lots of migration tools available. But I am not confident it will actually make good code.
|
|
|
|
|
|
Hello
I want to access cookies on my client machine through my web application.
With Best Regards
|
|
|
|
|
manish.m.meshram wrote: I want to access cookies on my client machine through my web application.
Beginner's Guide To ASP.NET Cookies[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi
add into cookie
Response.Cookies.Add(loginUserName)
Response.Cookies("UserName").Expires = DateTime.Now.AddDays("1")
and while retrieving
txthost.Text = Request.Cookies("hostAddress").Value
Amit Patel
|
|
|
|
|
Provided you can access the cookie only created by your webserver.
Means you cant access cookies placed by www.google.com..
|
|
|
|
|
i have developed a website in asp.net.now i want to create a internal search in website ....plz help me to tell me how to create it....in html,javascript,asp.net
|
|
|
|
|
hi ,
what do u mean by internal web site search?
Thanks,
Amit Patel
|
|
|
|
|
You want to develop your own search?
You can use normal sql code to get the search data and then show in your site.
Or you want to use Google Search to your website. If so see this :
http://www.askdavetaylor.com/how_can_i_add_a_google_search_box_to_my_web_site.html
|
|
|
|
|
For ur internal website search create a textbox and then a button.
write an extensive stored procedure which will search ur database(or part of it, depends on your functionality).
call this stored procedure everytime a user searches .
If the returned search data is more show it with paging on your page.
I have implemented this but my result was to be in a grid with paging if result had more than 10 values.
|
|
|
|
|
How can we show the bold text in textbox....
|
|
|
|
|
do this
<asp:TextBox ID="TextBox1" runat="server" Font-Bold="True"></asp:TextBox>
|
|
|
|
|
Use
txt.Style.Add(HtmlTextWriterStyle.FontWeight, "bold");
Or you can directly use
style="font-weight:bold;"
Cheers
|
|
|
|
|
Hi,try this,
<asp:TextBox ID="TextBox1" runat="server" Text="Hello" style="font-weight:bold"></asp:TextBox>
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:48pm.
|
|
|
|