Click here to Skip to main content
15,168,105 members

Comments by Taresh Uppal (Top 153 by date)

Taresh Uppal 11-Apr-13 1:14am View
I have already done that !
Taresh Uppal 11-Feb-13 7:06am View
Actually Ineeded the XML coz there will be two kinds of user..One having read only access to my app and other having read and write both. So to check the users of each kind I need to keep one of the user's data into the xml on the project itself So that I can differentiate easily and make my choices according to it.
Anyways thanx for the link. It worked for me and I have coded the xml part too. Thanx again !
Taresh Uppal 11-Feb-13 7:04am View
Hey Jose, Thanks for your time !
This provides me how to manipulate the data inside my excel sheet. However, I want is that like say If my excel is missing some column, If data type of some column is wrong, or if in a particular cell I need some custom data of specific pattern...How to achieve that ?
Taresh Uppal 11-Jan-13 0:58am View
I am using this page only for my reference however I am not able to get what's the problem. Means Where I need to actually modify my code so that the data I am entering in my sheet can also be visible in pie chart format ???
Taresh Uppal 9-Jan-13 1:34am View
Actually what I wanted to say is that I am not able to get a clear picture that from where to start and how to proceed. Thank you sir for your guidance. Will let you know once I conclude something out on my won. Hope you will help me again !
Taresh Uppal 20-Nov-12 6:09am View
dats what I am saying that i tried doing it dat way but it dint happened as i wanted .
Taresh Uppal 20-Nov-12 5:56am View
Is there even a event of this name exists for data list ???? I doubt ...:(
Taresh Uppal 20-Nov-12 5:56am View
Is there vene a event of this name exists for data list ???? I doubt ...:(
Taresh Uppal 23-Oct-12 1:49am View
m not getting any help guys :(
Taresh Uppal 22-Oct-12 5:59am View
hey devang..i have added dis css on my this page only...
Taresh Uppal 17-Oct-12 1:18am View
i have done it already

using (ExcelRange rng = ws.Cells[rowsCellRange])
rng.Style.WrapText = true;

rng.Style.HorizontalAlignment = ExcelHorizontalAlignment.Left;

here it makes a delay and i have no other option to write and guess the excel row range ...:(
Taresh Uppal 16-Oct-12 6:09am View
will anybody help ??
Taresh Uppal 16-Oct-12 5:44am View
I tried modifying my code with out that and it gave an error in cell range.This is ti specify that from A:XXX , Here XXX is the range of cell up to which data needs to be written !
Taresh Uppal 16-Oct-12 5:29am View
I am a newbie in this library. I guess we are making use of excel range which will allow creating headers as column names for our excel sheet. So by using this excel range is defined. Correct me if I am wrong somewhere !
Taresh Uppal 11-Oct-12 3:11am View
exactly !
I saw this link earlier also and I was amazed to see how this guy is working with the same ? Moreover I am not able to relate this blog to my code..:(
Taresh Uppal 11-Oct-12 3:11am View
how can I convert cell as a data type so that I can make it use further. I am confused a lot !
Taresh Uppal 11-Oct-12 2:45am View
ok i see... So is there any alternative to this referring to my code. Because the variables like cell,fill, vallign are custom type and they make me modify my excel sheet. Can i use any other substitute for the var keyword ??
Taresh Uppal 28-Sep-12 3:15am View
3.5 and i guess that has nothing to do with it..its some server side breakdown occurence if m not wrong..
Taresh Uppal 21-Sep-12 8:40am View
I am actually not using any progress bar..I am using progress image that too without any ajax.. it is supposed to stay on the page as long as the process goes on and once the label comes up I hide it throgh code behind :
Here it is :<td colspan="2">
<asp:Image ID="Image_progress" runat="server" Height="30px" ImageUrl="~/images/indicator.gif"
Style="visibility: hidden; text-decoration: blink;" ToolTip="Mining is in progress.."
Width="30px" />
<asp:Label ID="lbl_blink" runat="server" Font-Size="14px" Font-Bold="true" ForeColor="Red"
Text="Processing..." Style="visibility: hidden; text-decoration: blink;">
Taresh Uppal 21-Sep-12 7:30am View
any help now ???
Taresh Uppal 21-Sep-12 7:16am View
here is my dummy code too...
Taresh Uppal 5-Sep-12 6:29am View
now getting this error somehow dll is workin now
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
Taresh Uppal 5-Sep-12 6:28am View
Now getting this error when I try to open the sheet using method
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
Taresh Uppal 5-Sep-12 5:01am View
I am currently using mic interop library version 5.0 is it even compatible with server 2003 or do i need to use version
Taresh Uppal 5-Sep-12 3:40am View
Somehow I am able to get this error :Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
I have change the permission settings of dcom file too still I am getting the same error. Where I am i going wrong ??
Taresh Uppal 4-Sep-12 10:47am View
is dis free of cost ?
Taresh Uppal 4-Sep-12 7:38am View
any other idea ???
Taresh Uppal 4-Sep-12 7:19am View
darshan..I have already given full controls from all accounts...
Taresh Uppal 4-Sep-12 7:02am View
Sir, On my server microsft office 2007 is already installed.
Taresh Uppal 28-Aug-12 2:21am View
This thread will always remail close to my heart and coding senses...:)
Taresh Uppal 27-Aug-12 6:14am View
Somehow your scolding made my day. I am 22 years old and I sincerely appreciate the way you challenged me. What I did I saved the file on my server the same way I am doing than picked it up using interop.excel objects and after that made the modifications and saved it with a new name and deleted the old one. Thank you Sir, thanx a zillion times. I just wish my client will like it ! :)
Taresh Uppal 27-Aug-12 6:12am View
Thanx a zilion times ...:)
Taresh Uppal 27-Aug-12 1:55am View
I just collect the data in my datatable and than pass it to exporttofile method which converts it into a HTML table and after that I save the file in download folder of my project and pass the address of a specific file to the client as URL which helps him getting the download. Can u please tell me any link to write the file using com and interop library so that I can write data from my data table into excel and create a watermark in at the same time
Taresh Uppal 27-Aug-12 0:29am View
Well I am still doing it...the code that I showed you here is the all code I have which works for me. Its just that suddenly my boss's requirement changed and he asked me to add a water mark. Up to now everything was working fine and now I am stucked.
Taresh Uppal 25-Aug-12 7:48am View
Alryt Sir, I apologize here. May be I am doing something wrong. I will try my best to learn more and will surely seek your help than. Thank you for your time. Sorry again !
Taresh Uppal 25-Aug-12 5:55am View
This is physically saved in download folder of my project thats it ...
Taresh Uppal 25-Aug-12 5:54am View
why u geting hyper on dat ??? I have already no I am not storing anything anywhere... I fetch the data in datatable.. pass it to the 'exporttofile' thats all I have in my code. I dont know what do u mean by where do i store it ?

rest of the code is this which invokes a download box:

string strResult = bl_Query_for_admin.Query_Data(strWorkOrder,strDataType, From, To,strHSCODE, strComb, strProd,strProdNot);
if (strResult != "")

lblMsg.Visible = false;
lblMsg.Text = "";

string strDownloadPageURL = strResult;
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", " '" + strDownloadPageURL + "', null, 'height=400,width=800,status=yes,toolbar=no,menubar=no,location=no' );", true);


Query data is the method in my business logic where I have kept my above shown methods.
Taresh Uppal 25-Aug-12 5:43am View
we make a search query for minning data as simple sql query which brings the data and than I take action accordingly...
Taresh Uppal 25-Aug-12 5:42am View
string download_url = "";
int iResult = 0;
string strMonthName = Select_Month_Name(From);
string str_Search_Query_For_Data = search(strData, strHSCODE, strComb, strProd,strProdNot, From, To, strMonthName);

System.Data.DataTable dtResult = DAO_Con_diff_db.Select_datatable(conn_str_2012, str_Search_Query_For_Data);

if (dtResult.Rows.Count != 0)
iResult = 1;

if (strData == "EXPORT")
dtResult.Columns[5].ColumnName = "FOB VALUE INR";
dtResult.Columns[5].ColumnName = "ASSESSABLE VALUE INR";

string strDwnload_file_name = dwnlod_file_name(strWorkOrder);
ExportToFile(strDwnload_file_name, HttpContext.Current.Server.MapPath("~//download//" + strDwnload_file_name + ".xls"), dtResult, "" + "/" + strDwnload_file_name + ".xls");

string Url_of_HomePage = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath + "/";

download_url = "" + Url_of_HomePage + "download/" + strDwnload_file_name + ".xls";

the data is fetched inside a datatable and than this datatable is modified in my menthods i showed u above to make it as a xls extension.
Taresh Uppal 25-Aug-12 5:35am View
here is the rest of code:

string strDwnload_file_name = dwnlod_file_name(strWorkOrder);
ExportToFile(strDwnload_file_name, HttpContext.Current.Server.MapPath("~//download//" + strDwnload_file_name + ".xls"), dtResult, "" + "/" + strDwnload_file_name + ".xls");
//CreateCSVFile(dtResult, HttpContext.Current.Server.MapPath("~//download//" + strDwnload_file_name + ".csv"), "" + "/" + strDwnload_file_name + ".csv");
string Url_of_HomePage = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath + "/";
//download_url = "" + Url_of_HomePage + "download/" + strDwnload_file_name + ".csv";
download_url = "" + Url_of_HomePage + "download/" + strDwnload_file_name + ".xls";

I do nothing but pick a unique name for downloading the file, convert it into url, add .xls and thats all.
Taresh Uppal 25-Aug-12 1:49am View
this is the whole code...
Taresh Uppal 23-Aug-12 2:47am View
In the start I write my Company's info with a pic. After that data is written using column and rows. After my company's website is written there succesfully code enters here
foreach (DataColumn dCol in dtResult.Columns) <---- The first Column that Starts and actually having DATA
dataToExport.Append("<td style=\"border:solid 1px black; background-color:orange;\">");


and writes column for date, which is taking more space and I know that this is due to that info that I am writing. Because the column is taking the same width as that info column on the top is taking. So this is my problem. Company info is large and under that date comes as first column which doesn;t needs to take dat same space. Hope I am able to explain it better now.
Taresh Uppal 23-Aug-12 2:42am View
I tried this but I am saving the files on folder on my server. So creating duplicate files will create a issue of memory management. Don;t we have any other solution..? If u can help me bit more :(
Taresh Uppal 20-Aug-12 8:07am View
thanx I tried something same and it worked but now I am able to fetch the values from my labels on page 2. Kindly check my this thread and please help
Taresh Uppal 17-Aug-12 2:21am View
i dont thnk os there is any property with formname !
Taresh Uppal 17-Aug-12 2:15am View
could you please tel me where to use it ??
Taresh Uppal 17-Aug-12 2:14am View
pls help !
Taresh Uppal 16-Aug-12 8:16am View
the first name,last name,age are coming from first page and I am capturing them with the help of Js.
Taresh Uppal 16-Aug-12 8:15am View
and on page load :

lbl.Text = Convert.ToString(Text1.Text);
Taresh Uppal 16-Aug-12 8:15am View
<form id="form1" runat="server">
<asp:Label ID="lbl" runat="server"><br />
<asp:TextBox ID="Text1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" />
<%--/* javascript starts here*/--%>

<script language="JavaScript">
function getParams(){
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++){
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
return params;
params = getParams();
firstname = unescape(params["firstname"]);
lastname = unescape(params["lastname"]);
age = unescape(params["age"]);
//document.write("firstname = " + firstname + "
//document.write("lastname = " + lastname + "<br>");
//document.write("age = " + age + "<br>");
//document.getElementById('<%=lbl.ClientID%>').innerHTML = firstname;

document.forms["form1"].elements["Text1"].value = firstname;


Taresh Uppal 16-Aug-12 7:34am View
I did still the same result !
Taresh Uppal 16-Aug-12 3:13am View
Thank you for pointing that out ! :)
Taresh Uppal 13-Aug-12 7:43am View
the whole issue was that page was not getting loaded fully and I was trying to change the text of java script was not accessing my label. But when I pasted it after my label control on HTML it works smoothly. So ! I guess it was just my nonchalant behavior about page life cycle ! Gosh I learned a lesson :P
Taresh Uppal 13-Aug-12 7:37am View
hey thanx a lot for ur tym...i just solved it... It was page life cycle issue...
I referred to :
Taresh Uppal 13-Aug-12 7:31am View
however i just confirmed that variables firstname, lastname, age are not null, so there is some issue in passing the value to label i guess.
Taresh Uppal 13-Aug-12 7:12am View
got that its null !
Taresh Uppal 13-Aug-12 6:15am View
the js i have written is on html can i check that using breakpoints ?
Taresh Uppal 13-Aug-12 5:29am View
No its not a browser specific issue.... its not even working on internet explorer !
Taresh Uppal 13-Aug-12 5:07am View
Hello pradeep..thanx a lot for ur seuggestion. But still the label is empty !
Taresh Uppal 13-Aug-12 3:44am View
this is a variable cant i simply pass this value to label...why my label remains empty still... I am using
var lbl = document.getElementById('<%=lbl.ClientID%>');
Taresh Uppal 13-Aug-12 3:03am View
no is is not failing at all... Wat I want is just to show this data in labels instead of document.write(etc etc)...
I just want to use labels and set their text property to the values coming in first name, last name,age etc
Taresh Uppal 13-Aug-12 3:01am View
the values coming in unescape(params["firstname"]); etc are all fyn.. I just want to show dem in label so that I can asscess them from my code behing in future. Is it possible with some simple solution ?
Taresh Uppal 13-Aug-12 2:57am View
see the Question now
Taresh Uppal 13-Aug-12 2:57am View
I am using and c# and all this javascript... not php...I am bit confused :(
Taresh Uppal 13-Aug-12 2:48am View
I just want that the values coming in first name should be visible in label instead of writing it openly on the browser, I am trying to do this because later I have to use these values to process something. Anyone has better idea to achieve this ?
Taresh Uppal 13-Aug-12 1:57am View
could you please help me how to achieve it ?
Taresh Uppal 7-Aug-12 5:52am View
Anyways thanx a lot for all your code, help, support and patience on this issue. You are one of the best teammates I have ever seen. Thank you so much. Glad to follow your views.
Taresh Uppal 7-Aug-12 5:47am View
don;t know, after using direct link, even my objRequest is not null. I guess I have to let it go with that old monotonous way. This issue is I guess bigger than me.:(
Taresh Uppal 7-Aug-12 5:38am View
Now again a blank page is getting opened and code is showing no exception and dialogue box is not getting opened.
Here is my code:

System.Net.HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(strFilename);

System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();
objRequest.ContentType = "application/json; charset=utf-8";
objRequest.Credentials = CredentialCache.DefaultCredentials;
Response.AppendHeader("Content-Disposition:", "attachment; filename=" + strFilename + "");
Response.AppendHeader("Content-Length", objResponse.ContentLength.ToString());
Response.ContentType = "application/download";

Taresh Uppal 7-Aug-12 5:35am View
http://localhost:3549/ODMS/download/7-Aug-2012-13-12-12-AM-printers.csv is my download link which is saved in strFilename.
Taresh Uppal 7-Aug-12 5:33am View
Is it necassary to pass this ?
cant i directly use my download link, ? I want a simple thing that unless download is complete I dnt want user to see a black page, All I want is to show a html marked page and download in that, simply. Dont know where I am going wrong ...:(
Taresh Uppal 7-Aug-12 5:28am View
and now even that customised page is not coming. The whole issue is with this objrequest and objresponse...
Taresh Uppal 7-Aug-12 5:23am View
nope, it is null...
Taresh Uppal 7-Aug-12 5:12am View
I tried by just passing the source file download link and still that dialogue box is not coming.
Taresh Uppal 7-Aug-12 3:56am View
I tried your given code, In my case its a csv so how can i access to its contents, I mean you passed two parameters two your method one is file name and other is binary array..I am passing my file link that I wana get download and what shall i pass in file content ???
Taresh Uppal 7-Aug-12 3:47am View
I guess the download link is not valid...because now thanks to you atleast I am getting my page opened in that new tab however file is not getting download. The Url that we trying, the strfilename is correct but when I add it with than issue appears becuse "Download/" is a page and after that we adding download link to it without aspx at the end as it is a csv. Moreover it makes the totla link somethn k like dis : which is surely invalid i guess.
Taresh Uppal 7-Aug-12 3:40am View
I want that this download page should be open in a new tab as i have decided the hieght and width for it and lemme check the path and I will get back to you ..:)
Taresh Uppal 7-Aug-12 3:32am View
to b very honest before posting the code I tried this and got this same error :
The remote server returned an error: (404) Not Found.
Taresh Uppal 7-Aug-12 3:27am View
ok m trying this
Taresh Uppal 7-Aug-12 3:26am View
Isn;t there any way that download is received in my download.aspx page ???
Taresh Uppal 7-Aug-12 3:25am View
but it gives an exception that URL is empty in this line.
Taresh Uppal 7-Aug-12 3:13am View
The java script to open into anew tab if I pass the download link of the file it works properly but open a blank page not a customized one and if I pass the required parameters to the Download.aspx page than i get these errors. Now I guess I am more specific...
Taresh Uppal 7-Aug-12 3:12am View
hello, I really appreciate your help but this is not what I am looking for. I said that I am able to download files but still I want that the tab in which new page open for download should be designed and customized by me having something like "Please do not close this tab etc etc..." So that if server takes time to render the file on machine user don't close the tab. In order to achieve that I am using all this and not getting successful. I tried your code it said the URL is empty..:(
Taresh Uppal 3-Aug-12 2:35am View
Hey I did it...Called a external class for the same...thanx a lot...a zillion times :)
Taresh Uppal 3-Aug-12 2:12am View
Hey thank you so much for your awesome suggestion. I am almost about to win the situation. It is selecting the items as per my navigation however what I want is to change the color of the background of my menu item which is running at the moment. Is there any property except selected which can help me out ?? I am using external CSS class, is this the reason I am not able to do this ????
Please guide me !
Taresh Uppal 1-Aug-12 5:09am View
can u suggest me some good blogs, articles and E-books for the same ???
Taresh Uppal 1-Aug-12 3:35am View
Here is my CSS : .menu-panel{width:219px; float:left;border-right:#789bc9 1px solid; margin-right:8px;}
.menu-panel ul li{ list-style:none;}
.menu-panel ul li a {height:32px; display:inline-block; width:208px; text-decoration:none; font-size:13px; line-height:32px;
color:#204d89; background:url(../images/menu-bt.jpg) repeat-x; padding:0 0 0 10px;}
.menu-panel ul li a:hover,.menu-panel ul li a.selected{color:#000; background:url(../images/menu-btho.jpg) repeat-x;}

.menu-item{color:#4997c4; font:bold 15px/20px "Trebuchet MS", Arial, Helvetica, sans-serif; text-decoration:underline; padding-left:0px; display:block;}
Taresh Uppal 27-Jul-12 8:00am View
I did it bit following your advice, bit using my mind.. bit with my luck..Thanx a lot sir,,:)
Taresh Uppal 25-Jul-12 6:36am View
err...What I did...I binded my data outside if(!ispostback) and it solved the issue but the grid view is getting traversed only on the first page. And I have paging upto 30 pages. Even I made allow paging to false, still...what shall I do now ?
Taresh Uppal 25-Jul-12 6:03am View
Sir, I again made some changes and now the thing is on button click event I have to send mails to all the clients in my gridview except those on whom check box is checked. For this I am trying traversing my gv through foreach but my foreach is not working at all. It is not able to count the rows and traverse a single row.. y so ?
Taresh Uppal 25-Jul-12 2:45am View
Amit sir, actually this is the only thing left in my project and I am struggling on it since two days and somehow it always happen that i get some unusual error... The deadline is on the top now....:(
Taresh Uppal 25-Jul-12 2:35am View
can u please tell me whats wrong in my code that I used ...
Taresh Uppal 24-Jul-12 5:01am View
oops...I am sorry...but I had d same code..means eventname.. nothing happen still...
Taresh Uppal 18-Jul-12 5:57am View
Is there any blog or article whom I can refer to ?
Taresh Uppal 12-Jul-12 11:10am View
i used this:
scriptmanager.registerstartupscript(params) it..
Thanx for the advice !!!
Taresh Uppal 6-Jul-12 4:59am View
okie griff lemme try this...thanx
Taresh Uppal 5-Jul-12 6:45am View
Isn't there a tool into which wen we feed our code we can get the performance rating or something of same sort ???
Taresh Uppal 5-Jul-12 2:59am View
I have followed all the steps so far for developing this service still I am not getting success !
Taresh Uppal 5-Jul-12 1:08am View
Sir could you explain how to do it ? Actually I am a web developer and coding something on windows is new for me. PLease explain !
Taresh Uppal 5-Jul-12 1:03am View
in my project setup folder i m not able to find this .exe file. Have i not coded this windows service properly ???
Taresh Uppal 5-Jul-12 0:53am View
installutil.exe "C:Document and Settings\taresh\Desktop"
the system cannot find the file speciified
Taresh Uppal 30-Jun-12 3:46am View
ranjith for that u need to select that checkbox and take a button control in your grid view. On rowdeleting method traverse through the rows that which checkbox is checked and accordingly delete the row corresponding to it.

check it:
Taresh Uppal 30-Jun-12 3:42am View
as i have told u due to some reason javascript is not getting fired on my page..
Taresh Uppal 30-Jun-12 1:51am View
and earlier i ws using this code snippet earlier too
Selecting / Deselecting all the CheckBoxes Inside a GridView[^]
and now agin implemented it..still no go...
Taresh Uppal 30-Jun-12 1:47am View
Thanx for your help but as I said ealrier it was working and now its not..I am confused why is it happening..
Taresh Uppal 27-Jun-12 8:48am View
the download box is the open-save-cancel download dialogue box that usually comes on our window when we download something. The starnge thing is that even I am redirecting to a different page and on that page all the download box creation code is written incuding that content-disposition etc etc.
Still I get the download box on this page only and doesnt redircts me anywhere and that image stays there even after download process completes. This is all my issue.
Taresh Uppal 27-Jun-12 8:40am View
protected void btnDownload_Click(object sender, EventArgs e)
lblMsg.Visible = false;
lbl_date_error.Visible = false;
strHSCODE = Convert.ToString(ViewState["strHSCODE"]);
strDataType = Convert.ToString(ViewState["strDataType"]);
strCombination = Convert.ToString(ViewState["strCombination"]);
strProd = Convert.ToString(ViewState["strProd"]);
strProd_not = Convert.ToString(ViewState["strProd_not"]);

DataTable iResult = bl_my_account_client.Query_Data(strDataType, date_from_by_user, date_to_by_user, strHSCODE, strCombination, strProd, strProd_not);

if (iResult.Rows.Count != 0)
this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "JScript1", "hideImage();", true);

Session["Download"] = iResult;

lbl_date_error.Visible = true;
lbl_date_error.Text = "Error: This request cannot be processed ...";
I am downloading a csv file frfom database
Taresh Uppal 27-Jun-12 5:58am View
Help me please !
Taresh Uppal 5-Jun-12 0:39am View
MOreover what is this
[WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)]

it is gving so many errors. I commented them and run the process still no go.
Taresh Uppal 5-Jun-12 0:35am View
I tried using this but nothing happened ...
Taresh Uppal 30-May-12 2:10am View
I have seen people solving this issue some of them did it on row data bound event of Grid view and paging soem with javascript.. Only I am not able to solve it at the moment..So kindly help..:(
Taresh Uppal 30-May-12 1:33am View
I am not getting you ?? means wats the logic ?
Taresh Uppal 30-May-12 0:59am View
I am not getting the logic means do i have to use this with my existing javascript code ? and how it will select all the checkboxes on all the pages of gv ?
Taresh Uppal 28-May-12 3:46am View
I guess the problem is related to partial post backs Vs complete post backs as ajax update panel deals with asynch partial post backs ...AM i right ?
Taresh Uppal 28-May-12 3:00am View
and my cs coding is quite lengthy ...I simply get values from user on button click event of download button and get the records into datatable from DB and than write the data table into .xls file and gv it to the user in dialogue box. simple. Earlier when i was not using ajax the code was working fine... when my boss asked me to implement this functionality after that I am not able to get dialogue box. Simply to say when my file is ready and can be shown to the user update panel should allow it to open the dialogue box but it is not happening.
Taresh Uppal 28-May-12 2:53am View
This is how my file (.xls)comes to the user in dialogue box

if (!string.IsNullOrEmpty(dataToExport.ToString()))


HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=offline_data.xls");

Taresh Uppal 28-May-12 2:45am View
Sir I am already using ajax controls...To be very honest i find your links bit tough to use as I am new in c#. Is there any way i can modify my coding and get the desired results ?? The problem I am facing is that when update panel finishes its updating and when my page is supposed to get a post back to open a dialogue box for downloaded data... Nothing happens. I simply mean that final task is not occurring whether its opening a dialogue boz or wether showing some text in label etc. Why this is happening ?
Taresh Uppal 28-May-12 2:38am View
The problem is that when i use update panel and update progress.. my file download open-save box is not opening at the end. If i choose not to download but to email the data to my client than still a conformational message that whether email has been sent or not is not shown even if i try. So do u have any solution for this ?
Taresh Uppal 26-May-12 4:54am View
can u help me ?
Taresh Uppal 26-May-12 3:34am View
Sir i have solved the problem somehow...using ajax update panel extender and update panel but after the completion of process the panel still rermains in the hold process and the image stays there.....and i have given the thread sleep to 5 secs only doesnt goes back...
Taresh Uppal 26-May-12 2:21am View
Mr. SAndeep..Thanx for your reply sir... But to be honest i have ajax control toolkit but it doesnt have this tool update progress...even i have changed two dlls still i dnt get it..if i get ajax dll 4.0 than it doesnt let me incorporate the dll as its not a valid microsoft soft dll...etc etc...even m frustrated why this is happening
Taresh Uppal 25-May-12 3:57am View
There is a reason for this coz next tym when the page loads then i dnt want all the fields to change ...i have datefrom and dateTo text boxes whose value i want to change as per user request...
if i kp the thngs in postback than on secnd tym load all the values go empty...:(
Taresh Uppal 25-May-12 3:56am View
on the page load but outside if(!ispostback)...
Taresh Uppal 24-May-12 11:37am View
i have already done this before posting quetion always do one thing..when i click the dwnload button it gets d value from session again... is it possible just to use the session once first tym and after that removing it for the next postbacks...?
Taresh Uppal 24-May-12 6:25am View
on the button click event i have taken a variable
DateTime dtFrom = Convert.TodateTime(txtFrom.text);
Simple....during first time it feeds the thing correctly but after that when button click is reached it always takes the value that was in session for this textbox not the new value if user had entred in it. Moreover i m populating this textbox in page load but outside if(!ispostback)..coz using if(!isnot...) on button click it makes all the fields empty and txtdate gves wrong value...
Taresh Uppal 24-May-12 5:50am View
if I do that still once the button is clikced i get the same error that date time is nota valid string coming from the textbox.
Taresh Uppal 24-May-12 5:18am View
this happens on my page load from wher text box is populated very first tym:
if (!IsPostBack)
pn_Details_Particular_Query.Visible = false;
lblMsg.Visible = false;


if (Session["Client_Particular_Query_Details"] != null)
DataTable dtDetails = (DataTable)(Session["Client_Particular_Query_Details"]);
if((dtDetails != null)||(dtDetails.Rows.Count !=0))


and the button coding i have shown u...please reply
Taresh Uppal 24-May-12 5:02am View
thanx a lot for your response... but when i am not loading the text boxes on page load..means (!ispostback)....coz when i do it ..than on button click when i try to retrieve the text box value it says it is not a valid date time string...:(
Taresh Uppal 24-May-12 4:06am View
if i wont do it..than info will be missing..than how would text box be automatically populated the very first time when the user visits the page ?? I understand your point but doing it is the only way i guess...
Taresh Uppal 21-May-12 1:53am View
hey sunny thanx for your time...I solved it myself...Actually earlier I was trying to implement the logic using Gv_rowDataBound event. so i forgot to remove the event. Once i Did it its working fyn. Thanx for ur patience.
Have a great day//:)
Taresh Uppal 21-May-12 1:49am View
so now once editing is done and if say ddlActive has updated to Yes than next time on editing if have only two option in that ddl YES and YES...and do remember that the ddls in my gvs, they have list items already in my design..only there value is dynamically highlighted.
Taresh Uppal 21-May-12 1:46am View
Sure here it is ...

protected void gv_WorkOrder_Edit_RowEditing(object sender, GridViewEditEventArgs e)
int iClientId = Convert.ToInt32(Session["ClientID"]);

Label lblDataType = (Label)gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("lblDATATYPE");
Label lblComb = (Label)gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("lblCOMBI");
Label lblActive = (Label)gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("lblActive_Single");

gv_WorkOrder_Edit.EditIndex = e.NewEditIndex;

DropDownList ddlData = ((DropDownList)(gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("ddlDataType")));
DropDownList ddlComb = ((DropDownList)(gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("ddlComb")));
DropDownList ddlActive = ((DropDownList)(gv_WorkOrder_Edit.Rows[e.NewEditIndex].FindControl("ddlActive_Single")));

ddlData.SelectedItem.Text = lblDataType.Text;
ddlComb.SelectedItem.Text = lblComb.Text;
ddlActive.SelectedItem.Text = lblActive.Text;

Taresh Uppal 21-May-12 1:40am View
Hi sunny..somehow i solved it by myself.... and i did it by fetchin the value of label on editing of gv and than assigning the drop downs that value.
However a small bug is there. I have used many gvs and in some gvs its working fine and in sme gvs what it does that if yes or no is there and no is populated on editing and i update it to yes than next tym during edition i have two option yes and yes only... why is it happening ?
Taresh Uppal 16-May-12 5:15am View
I will be waiting for any suggestion...Thanx
Taresh Uppal 16-May-12 3:41am View
I have omitted the '<%= this.gvAllClients.ClientID %>' from document.getElementById() but still on bton click its not entering into the loop, it simply makes the grid view invisible and do nothing.
Taresh Uppal 16-May-12 3:33am View
Amit sir... i poste dthis so that there are no issues for other developers... moreover..i tried ur suggestion its same issue...
Taresh Uppal 16-May-12 3:26am View
Amit sir ..Thanx a lot for your help but things arent working they should.. kindly see all the comments between me and Mohammad , You will got to knw my problem... a new issue is there....
Taresh Uppal 16-May-12 3:23am View
When i enter into start the loop it takes me to the javascript instead of entering the loop
Taresh Uppal 16-May-12 3:20am View
okie its down there...
Taresh Uppal 16-May-12 3:02am View
NO Its is not... the new problem is this on checking of check box I am trying to send a email to the respective clients. However now it is not allowing me...I check a checkbox and click on send email it goes to that function of javascript and does not go into for each loop which will pick the email id of selected cell... why this ?
Taresh Uppal 16-May-12 2:24am View
Thank you so much..I have seen this post earlier but it was complex so for tym saving I didn't used it. But, Atlast its working. Thanx a Zillion
Taresh Uppal 16-May-12 2:14am View
Hi, Mohammad.... I have done everything....I dnt knw why am not able to do this. I am using a code which is running perfect on another website but not doing the things on my website...
Taresh Uppal 16-May-12 1:58am View
Please reply Asap , MY boss is waiting for me...:(
Taresh Uppal 14-May-12 1:51am View
suppose if datatable has string strActive = "yes"; than drop dwn list should show Yes ...
Taresh Uppal 14-May-12 1:50am View
No you are getting me wrong...this drop downlist needs to populate through a string whose value cmes in the datatable which is binding the gv
Taresh Uppal 9-May-12 0:26am View
I am not getting you...where I am goin wrong... means why my excel attachment is empty ?
Taresh Uppal 4-May-12 8:23am View
That was it...Thanx a lot..With little editing it is acceptable by my boss !!!
Thanx a lot
Taresh Uppal 23-Apr-12 1:16am View
I am not binding my grid view at page load... it gets binded on item command event of a i guess it will generate errors !
Taresh Uppal 23-Apr-12 1:11am View
I am not binding my grid view at page load... it gets binded on item command event of a i guess it will generate errors !
Taresh Uppal 2-Apr-12 6:30am View
I have done somwwat like this only but wenever I close my browser and open it again it doesnt keeps me login however it redirects me to the login cookies are not playing there role...
Taresh Uppal 15-Mar-12 3:16am View
hi..thanx a lot this was really awesome however I have a doubt here..In my task i wanted n number of panels that will be generated according to the values(ids)in my database. header panel will show id and when we will click on it it will show content panel contatining the info of that id. How to do that ??
Taresh Uppal 15-Feb-12 7:40am View
I got but I am new to this technology so i dnt know javascript right now so i
wanted to close the prev page too and that too in c# ..can U suggest Rajeev?
Taresh Uppal 11-Feb-12 2:48am View
I have done this but using this it shows a new error which says
Invalid column name 'newsId'.
Invalid column name 'newsId'.
Invalid column name 'newsTitle'.
Invalid column name 'shortnews'.
Invalid column name 'newsDetails'.
Invalid column name 'postedDate'.
Invalid column name 'newsStatusFROM'.