yes
ashutosh_karna
Posts
-
How to save webpage to client machine in asp.net -
how do put java applet and slideshow in asp.net -
How to save webpage to client machine in asp.netI have a some report messages in a content place holder within a master page in .aspx page. I want to put a "Save Button" on my page, which saves the webpage to user's computer (just like "SaveAs File dialog box" in windows application". Can anybody tell me how do I save a webpage in .txt or .pdf or .doc or .htm format (any of theses) on button click event
-
Calling Button_click event from Tab key_press eventI have a gridview in webpage, which generates a new row with 2 textboxes on clicking a button by end - users. Now, I dont want my users to press a button each time they want to add a new row & then enter some data in textboxes. Instead, I want to call button_click method as soon as "tab" key is pressed and focus is automatically set to the next row's first textbox. How can I do it in asp.net with C#? Please also, tell which namespace is to be added.
-
how to make source code uneditableI have created a very powerful web-based software as part of my thesis. Though, nobody helped me in my project, yet I have to submit my software with full source code. Some of the features of my software are unique & even not available in SAS or SPSS. However, some of the scientists at my Instt. will publish & commercialize it without mentioning my name anywhere and all my effort will so far, would become futile. Is there, any way that I can make the source code uneditable or encrypted, so that nobody can edit it except me. Or is there any way that I put my name in the source code such that nobody will be able to remove afterwards. Please help :(
-
Fetching value from textbox dyanamicallyI have a web form with a table control. No. of columns & no. of rows are asked by user and table is generated with cells filled with textboxes dynamically. The id of textboxes are generated dynamically. User enters the values in textboxes in table & click calculate button, on which I want to supply a set of results based on input data. Can anybody tell me how to fetch the value entered in a textbox at runtime. I am using following code. public void CreateTableRawData(int rows) { for (int i = 0; i < rows; i++) { TableRow tr = new TableRow(); TableCell td = new TableCell(); TextBox txt = new TextBox(); td.Controls.Add(txt); txt.ID = "txt" + i.ToString(); tr.Cells.Add(td); Table1.Rows.Add(tr); Table1.Caption = "Raw Data Form"; } } protected void Button2_Click(object sender, EventArgs e) { int rows = Convert.ToInt32(TextBox_rows.Text.ToString()); double[] data = new double[rows]; string [] dataText = new string[rows]; Table tbl = (Table)Panel1.FindControl("Table1"); for (int i = 0; i < rows; i++) { data[i] = Convert.ToDouble(Table1.Rows[i].Cells[0].Text.ToString()); } data[0] = Convert.ToDouble(Table1.Rows[0].Cells[0].ToString()); Label lbl = new Label(); double sum = DistributionFitting.Statistics.Sum(data); lbl.Text = sum.ToString(); } I am getting following error at runtime. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index
-
password recovery in asp.net 3.5I am using windows Vista with IIS 7. I created an asp.net application with passsowrd recovery control that sends password to user by email. But each time I try to recover a password, it shows an error message "An existing connection was forcibly closed by remote host". I have also installed a 3rd party tool SmartMail smtp server, but I do not know how to configure it in web.config file of my application. Please tell in detail as I dont have any idea of using smtp server.
-
How to build a guestbook or How to send mail filled with form itemsI want to make a guestbook for users visiting my site. I have some textboxes wherein user enters his name, email address, & a message. At the bottom there is a button called "post". As soon as a user fills up the textboxes & clicks post buuton. I want the message to be shown on my page along with their details. Does anybody have an idea how to do this? Or How can I send a mail filled with form item details.
-
Null reference exception in gridview binding to text dataI am binding the same gridview to excel or text data based on user selection, and passing the dataview in session to different page for further analysis. It works fine when the user selects excel data; but in case user selects text data, it shows Null Reference exception in another page. Code is as follows: protected void Button_view_click( object sender, Eventargs e) { if(....=="Excel") { BindExcel(); } else(.... == "text") { BindTExt(); } GridView1.EnableViewState = true; dv = GridView1.DataSource as DataView; Session["DataViewExcel"] = dv; } In anothere page, i am using following code : Private void PageLoad() { DataView dv1 = new DataView(); DataTable dt1 = new DataTable(); dv1 = Session["DataViewExcel"] as DataView; dt1 = dv1.ToTable(); // Exception occurs here, only in case of text data } Stack Trace is as follows : Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] PreThesisSoftware.DiscreteDistribution.Page_Load(Object sender, EventArgs e) in C:\Users\Ashutosh\Documents\Visual Studio 2008\Projects\UploadFile\PreThesisSoftware\PreThesisSoftware\DiscreteDistribution.aspx.cs:23 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
-
how to save gridview contents in cache at runtimeI have an editable gridview with blank cells. User enters some numeric data in cells & clicks a button. My problem is that, as soon as button click event is fired, the page refreshes & the gridview becomes empty. Can anybody tell me, how can I save values in cache so that button click event does not result in loss of data. ?
-
how to make a gridview editable [modified]I made a simple gridview in asp.net using the code written below. Now I want to make it editable so that at run time user can enter some data. Also,I dont want to put a thing like "edit button" ,i.e a user can simply edit a cell as he does in an excel spreadsheet. Can anybody tell me which event make the gridview editable ( I am not using any database) ? If possible, please give some code to help me understand. protected void Page_Load(object sender, EventArgs e) { dt = new DataTable(); Char[] alpha = { '#', 'A', 'B', 'C', 'D', 'E'}; for (int i = 0; i < alpha.Length; i++) { dt.Columns.Add(alpha[i].ToString()); } for (int i = 0; i < 1000; i++) { DataRow dr = dt.NewRow(); dr[0] = i + 1; dt.Rows.Add(dr); } GridView1.BorderColor = System.Drawing.Color.FromArgb(0, 0, 0); GridView1.DataSource = dt; GridView1.DataBind(); }
modified on Saturday, June 6, 2009 3:56 PM
-
Copying or Converting datacolumn into arrayThanks for taking interest in my problem. My solution file successfully builds up at compile time but at run time , I am getting following error. Please help. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Specified cast is not valid. Source Error: Line 93: { Line 94: //FIx to hand nulls if necessary Line 95: data.Add((double)r["A"]); Line 96: } Line 97: // return (double[])intValues.ToArray(); Source File: C:\Users\Ashutosh\Documents\Visual Studio 2008\Projects\testing_buttonClickEvent\testing_buttonClickEvent\Default.aspx.cs Line: 95 Stack Trace: [InvalidCastException: Specified cast is not valid.] testing_buttonClickEvent._Default.Button1_Click(Object sender, EventArgs e) in C:\Users\Ashutosh\Documents\Visual Studio 2008\Projects\testing_buttonClickEvent\testing_buttonClickEvent\Default.aspx.cs:95 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +107 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3436
-
Copying or Converting datacolumn into arrayCan anybody tell me how can I copy a whole data column from a data table into an array of integers ? OR how can I read values of all the rows of a datacolumn (using for loop) and then pass these values to an array (double [] data).
-
Sending values of GridView, Datatable in asp.net in sessionHello Friends, I am new to ASP.net. I want to make an asp.net page (which look like a spreadsheet)wherein, the user enters some data in one or more columns. Clicks the button, & the required result is displayed on another page. I made a simple editable gridview in asp.net (default.aspx) and put some numeric data & clicked the button. Now how can I pass the values ( as an array) stored in one or more columns to another page(result.aspx) to carry out further analysis. I want to call following method to data array(values stored in column of previous page) public static double Mean(double [] data) //DATA IS THE COLUMN OF GRIDVIEW { int n = data.length; double mean = Sum(data)/n; return mean; } Please Help with Proper Coding for storing GridviewColumn in session & then retrieve it onto another page to call the method above. PLEASE HELP
-
How to pass & retrieve gridview as session variable.Hello Friends, I am new to asp.net , so please help me out. I have made a small gridview ( without any database connectivity) on page(Default.aspx). The user fills up one of the column with numeric data & clicks a button & control is transferred to another page(Results.aspx). Can anybody tell me how can I pass the whole gridview as session varaible & then retrieve it in another page & further retrieve the column filled up by the user. Code in "Result.aspx" protected void Page_Load(object sender, EventArgs e) { DataView dv1 = new DataView(); DataTable dt1 = new DataTable(); Session["A"] = dv1.Table.Columns["A"]; } protected void TextBox1_TextChanged(object sender, EventArgs e) { // double[] data = new double[Session["A"]]; // WRONG CODE . PLEASE CORRECT IT // WRITE CODE FOR RETRIEVING COLUMN THAT USER HAS FILLED UP IN GRIDVIEW IN default.aspx } Code in "Default.aspx" : protected void Button1_Click(object sender, EventArgs e) { Server.Transfer("NewPage.aspx"); // HOW TO PASS GRIDVIEW ALONG WITH USER DATA }
-
Reading & Modifying data grid cell entriesHi, I am trying to make a spreadsheet in asp.net wherein, the user can enter some data and I display results for one of my methods( say Average, Standard deviation etc,). Can anybody please guide me how I read data from spreadsheet at runtime & then pass these data as parameter to my methods. e.g public static double Sum( double [] data) { double sum =0.0; for(int i=0;i