|
document.getElementById(id).style.display="none" for hide ur div.
document.getElementById(id).style.display="inline" for show ur div
Devjit Das.
|
|
|
|
|
I want to save Files of My virtual folder in Client-TEMP Directory automatically when I open the web application..through Code using Dotnet???
|
|
|
|
|
Vanamaindia wrote: I want to save Files of My virtual folder in Client-TEMP Directory automatically
It's not possible because ASP.NET works on server and it can't write any files to client.
|
|
|
|
|
Hi Friends,
Currently i am working on 1 Crystal Report which have 22 pages(22 page design ).
And client requirement is that he must need this report exported in PDF with textboxes in PDF.
Can any one please know me how i can export my report in PDF with textboxes in PDF?
Client don't want this report in word or other Format, He must require only in PDF.
Thanks in advance.
With Regards,
Mayank Prajapati
MCP, MCTS .Net 2.0
|
|
|
|
|
Mayank Prajapati wrote: And client requirement is that he must need this report exported in PDF with textboxes in PDF.
PDF is read only file, moreover it can't contain controls like TextBox.
|
|
|
|
|
Hi,
I want the users of my website to be able to print a datagrid on one of the webpages. Now my problem is that when the user does so one of the columns is cut off due to the page orientation. But if I set the page orientation to landscape manually it prints the entire datagrid.
How do I set the page orientation to Landscape programatically.
Is there some way I could achieve this using the CSS file?
Thanks in advance,
Avesh
|
|
|
|
|
Aavesh Agarwal wrote: How do I set the page orientation to Landscape programatically.
ASP.NET don't have any handle in printing. It's completely browser depended. What you can do is re arrange the grid to fit for printing.
|
|
|
|
|
From what I can gather, since a web service is stateless, then I cannot use global.asax in a web service to store application variables. For example, in classic asp, I could do the following...
-->
Sub Application_OnStart
set g_pcmsrv=Server.CreateObject("PCMServer.PCMServer")
set application("g_pcmsrv") = g_pcmsrv
End Sub
<--
With the above example, I can see and use g_pcmsrv anywhere in the web app.
But the same will not work in a web service....
<--
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
Dim g_pcmsrv As Object = Server.CreateObject("PCMServer.PCMServer")
Application("g_pcmsrv") = g_pcmsrv
End Sub
-->
With the above, I get a 'object not set to a reference' error.
Does anyone know a workaround?
Thanks VM
Paul
|
|
|
|
|
I create HTML table in asp.net forum like this;
for(int i=0; i<count; i++)
Response.Write("<TABLE><TR><TD width...
All created table have a one row (<TD>) and all <TD> contain one link like this;
...<a href=\"Post.aspx\">" + discussionTopic + "</a>...
User press the Link so open Post.aspx page. I want to send informatin (Topic ID) when link is clicking. How can I do? I try LinkButton but its not working in Response.Write(). How can I send data to Post.aspx when user click the link?
Best Regards...
|
|
|
|
|
Why don't you use the Repeater control? You can define the template and add controls to it.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
I solve my problem. I used QueryString.
Thanks a lot...
|
|
|
|
|
how to fetch contiguous numbers from a string
yogesh
|
|
|
|
|
One at a time ? If you give an example of what you mean, perhaps we can help. If it's a comma seperated list, just use the Split function to turn into a string array. USe int.tryparse if you want them to come out as ints instead of strings.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i m trying that i have one string "260px" this is got by
panel23.style["top"]..... i m trying to fetch 260 from this string , for further manupulations.
yogesh
|
|
|
|
|
The regular expression "\d{2,}" will match any sequences with two or more digits.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
Firstly:How can I get MessageBox in ASP.Net Page by using C#.When I am Using Response.Write("alert('Employee ID already Exits');"); Font of my Label's in the ASP.Net page getting changed...
Secondly:I am using Microsoft Access as my Back end.Their I created an Employee table and I am Inserting ,Updating and Deleting the records of that table.Created EMPLOYEE ID as primary key.
What I trying to get is that when I am trying to Insert a Duplicate record (i.e Same Employee ID which is already present)a message Box Show that Record already present.
Regards.,
Deepak
-- modified at 13:08 Tuesday 6th November, 2007
|
|
|
|
|
Deepak Koduri wrote: When I am Using Response.Write("alert('Employee ID already Exits');"); Font of my Label's in the ASP.Net page getting changed...
That's because you are writing out the code before the code of the page. That makes the browser ignore the doctype tag and render the page in quirks mode.
Use the Page.ClientScript.RegisterStartupScript method to put the script in the page.
Deepak Koduri wrote: What I trying to get is that when I am trying to Insert a Duplicate record (i.e Same Employee ID which is already present)a message Box Show that Record already present.
Either check for the id before you add the record, or handle the exception that is the result of trying to add a duplicate id.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi Guffa.,
How to use this method (Page.ClientScript.RegisterStartupScript)& with which arguments I have to pass in the following code.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class Login : System.Web.UI.Page
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=C:\\Project\\DataBase.mdb;Persist Security Info=False;");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
string s = "Select EmpID from Employee where EmpID=@id1;";
con.Open();
OleDbCommand cmd = new OleDbCommand(s, con);
cmd.Parameters.Add("@id1", OleDbType.VarChar);
cmd.Parameters["@id1"].Value = TextBox1.Text;
OleDbDataReader dr;
dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Write("alert('Employee ID already Exits');");
}
else
{
string s1 = "insert into Employee values(@id1,@id2,@id3,@id4,@id5,@id6,@id7,@id8,@id9,@id10,@id11,@id12,@id13,@id14);";
con.Open();
OleDbCommand cmd1 = new OleDbCommand(s1, con);
cmd1.Parameters.AddWithValue("@id1", TextBox1.Text);
cmd1.Parameters.AddWithValue("@id2", TextBox2.Text);
cmd1.Parameters.AddWithValue("@id3", TextBox3.Text);
cmd1.Parameters.AddWithValue("@id4", TextBox4.Text);
cmd1.Parameters.AddWithValue("@id5", TextBox5.Text);
cmd1.Parameters.AddWithValue("@id6", TextBox6.Text);
cmd1.Parameters.AddWithValue("@id7", ListBox2.Text);
cmd1.Parameters.AddWithValue("@id8", TextBox7.Text);
cmd1.Parameters.AddWithValue("@id9", ListBox5.Text);
cmd1.Parameters.AddWithValue("@id10", ListBox4.Text);
cmd1.Parameters.AddWithValue("@id11", TextBox8.Text);
cmd1.Parameters.AddWithValue("@id12", BasicDatePicker1.Text);
cmd1.Parameters.AddWithValue("@id13", TextBox9.Text);
cmd1.Parameters.AddWithValue("@id14", ListBox3.Text);
cmd1.ExecuteNonQuery();
//Response.Write("alert('Inserted')");
con.Close();
}
}
private void Write(string p)
{
throw new Exception("The method or operation is not implemented.");
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
con.Open();
OleDbCommand cmd = new OleDbCommand("select * from Employee where EmpID=@id1", con);
cmd.Parameters.AddWithValue("@id1", ListBox1.SelectedValue.ToString());
OleDbDataReader dr = cmd.ExecuteReader();
dr.Read();
TextBox1.Text = dr.GetString(0);
TextBox2.Text = dr.GetString(1);
TextBox3.Text = dr.GetString(2);
TextBox4.Text = dr.GetString(3);
TextBox5.Text = dr.GetString(4);
TextBox6.Text = dr.GetString(5);
ListBox2.SelectedValue = dr.GetString(6);
TextBox7.Text = dr.GetString(7);
ListBox5.SelectedValue = dr.GetString(8);
ListBox4.SelectedValue = dr.GetString(9);
TextBox8.Text = dr.GetString(10);
BasicDatePicker1.DayStatusBarText= dr.GetString(11);
TextBox9.Text = dr.GetString(12);
ListBox3.SelectedValue = dr.GetString(13);
con.Close();
}
protected void Button3_Click(object sender, EventArgs e)
{
string s = "Update Employee set Pass=@id2,FName=@id3,LName=@id4,Address=@id5,HomeNo=@id6,Sex=@id7,EmailID=@id8,Designation=@id9,Education=@id10,Skills=@id11,JoinDate=@id12,CProject=@id13,PStatus=@id14 where EmpID=@id1;";
con.Open();
OleDbCommand cmd = new OleDbCommand(s, con);
cmd.Parameters.AddWithValue("@id2", TextBox2.Text);
cmd.Parameters.AddWithValue("@id3", TextBox3.Text);
cmd.Parameters.AddWithValue("@id4", TextBox4.Text);
cmd.Parameters.AddWithValue("@id5", TextBox5.Text);
cmd.Parameters.AddWithValue("@id6", TextBox6.Text);
cmd.Parameters.AddWithValue("@id7", ListBox2.SelectedValue);
cmd.Parameters.AddWithValue("@id8", TextBox7.Text);
cmd.Parameters.AddWithValue("@id9", ListBox5.SelectedValue);
cmd.Parameters.AddWithValue("@id10", ListBox4.SelectedValue);
cmd.Parameters.AddWithValue("@id11", TextBox8.Text);
cmd.Parameters.AddWithValue("@id12", BasicDatePicker1.SelectedDate);
cmd.Parameters.AddWithValue("@id13", TextBox9.Text);
cmd.Parameters.AddWithValue("@id14", ListBox3.SelectedValue);
cmd.Parameters.AddWithValue("@id1", TextBox1.Text);
cmd.ExecuteNonQuery();
//Response.Write("alert('Inserted')");
con.Close();
}
protected void Button4_Click(object sender, EventArgs e)
{
string s = "delete from Employee Where EmpID=@id1;";
con.Open();
OleDbCommand cmd = new OleDbCommand(s, con);
cmd.Parameters.AddWithValue("@id1", TextBox1.Text);
cmd.Parameters.AddWithValue("@id2", TextBox2.Text);
cmd.Parameters.AddWithValue("@id3", TextBox3.Text);
cmd.Parameters.AddWithValue("@id4", TextBox4.Text);
cmd.Parameters.AddWithValue("@id5", TextBox5.Text);
cmd.Parameters.AddWithValue("@id6", TextBox6.Text);
cmd.Parameters.AddWithValue("@id7", ListBox2.Text);
cmd.Parameters.AddWithValue("@id8", TextBox7.Text);
cmd.Parameters.AddWithValue("@id9", ListBox5.Text);
cmd.Parameters.AddWithValue("@id10", ListBox4.Text);
cmd.Parameters.AddWithValue("@id11", TextBox8.Text);
cmd.Parameters.AddWithValue("@id12", BasicDatePicker1.Text);
cmd.Parameters.AddWithValue("@id13", TextBox9.Text);
cmd.Parameters.AddWithValue("@id14", ListBox3.Text);
cmd.ExecuteNonQuery();
//Response.Write("alert('Inserted')");
con.Close();
}
}
Regards.,
Deepak
|
|
|
|
|
|
I have one form. When I took the Form to ReadOnly state all the controls in the form are need to be in readonly,
A) I have Gridview. How to make this Gridview to ReadOnly. Currently I am doing the gridview.enabled = false. It greyed out the gridview.
B) And I have some validation controls, I want to supress that validations when the form is in Readonly.
Thanks
|
|
|
|
|
A) You have to Navigate through the control Collection of the Gridview and set the property to Read-Only/ENABLED-False.
B) You have to set the Enabled property of the validation controls to false. Page has GetValidators("group") method. Check whether this helps you in some way to disable all the validation controls at once, since it returns the validators to the ValidatorCollection object.
Regards - J O H N -
|
|
|
|
|
i am trying to update row in table (data grid ) but unable to do it .. this is what i have done so far ..
protected void UpdateCommand(object source, DataGridCommandEventArgs e)
{
Response.Write("testing");
SqlConnection conn = new SqlConnection(connectionString);
try
{
conn.Open();
string database1 = "Level1";
TextBox UserName = (TextBox)(e.Item.Cells[2].Controls[0]);
TextBox MacAddr = (TextBox)(e.Item.Cells[3].Controls[0]);
DataSet ds = new DataSet();
SqlCommand myCommand = new SqlCommand("UPDATE " + database1 +
" SET UserName = '" + UserName +
"', MacAddr = '" + MacAddr+" ' ", conn);
myCommand.Connection = conn;
myCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
Response.Write(ex.Message);
Response.End();
if (conn != null) conn.Close();
return;
}
finally
{
Response.Redirect((string)Session["PreviousURL"]);
}
conn.Close();
DataGrid1.EditItemIndex = -1;
can someone help me how to update after we clik edit button in each textbox in a row ??
Thanx !!
-- modified at 11:39 Tuesday 6th November, 2007
|
|
|
|
|
rocky811 wrote: i am trying to update row in sql database
rocky811 wrote: SqlCommand myCommand = new SqlCommand("UPDATE " + database1 +
" SET UserName = '" + UserName +
"', MacAddr = '" + MacAddr+" ' ", conn);
You can't do that unless you understand the Basic's of SQL. I would reccomend you to go through the Basic's Of SQL Commands.[^]
Regards - J O H N -
|
|
|
|
|
can u help me with the above code please ?
|
|
|
|
|
Database doesn't have rows. Only tables in the Database can contain Row's. what is that you are trying to do exactly in that code?
I have sent you a link to Read the Basic's of SQL Command. If you go through it you will understand how to write a UPDATE statement in SQL.
Regards - J O H N -
|
|
|
|
|