|
hi i am using a uploadfile control trying to save my file into a folder in the project instead of using a static file path.
anyone know the syntex to get the project path or any other way this can be achieve?
|
|
|
|
|
Not 100% sure what you're after, but Server.MapPath("") will give you the physical path to the current file - you can amend the parameter accordingly to get the path to another file (insert a re;lative file path). If that's not what you want, maybe the Request.ServerVariables collection will do it for you.
|
|
|
|
|
thanks very much for your help
|
|
|
|
|
hi
can any body tell me how can i create a popup with click a button? i wrote this code but it dose'nt work.
Response.Write("function d(){windows.open(Default2.aspx);}")
|
|
|
|
|
You know, it's not that I want to be unhelpful.. but...
a) if you can't figure this out for yourself you should maybe consider doing something else. Here are two hints: 1) Try Google. 2) Try loking at the source code of any webpage that generates a popup and see how they've done it.
b) you're in the wrong forum - try web development
|
|
|
|
|
|
You're outputting a function to the screen. Do you have code somewhere else that actually calls this function?
|
|
|
|
|
i write just this form:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(function d(){windows.open
('Default2.aspx', 'kk', 'width:400;height:150;scrollbars:no');},");
}
|
|
|
|
|
It's hard to know where to begin with this, it is wrong in so many ways...
If you want Button1 to open a new window on being clicked you need to add client side javascript to a) do this and b) stop the postback (unless you want this too). You can ad this from your code if you want by adding this in the page_load event
Button1.Attributes.Add("onclick", "window.open
('Default2.aspx', 'kk', 'width=400,height=150,scrollbars=no'); return false;");
But unless you either want the postback event as well (in which case don't return false) and/or want to dynamically build the script (ie mayb popup a different window depending on ohther factors| you needn't have serve control at all - just use a normal inoput button on your page and load the script there
<input type="button" onclick="window.open
('Default2.aspx', 'kk', 'width=400,height=150,scrollbars=no')" text="Submit">
(which is pretty much how the server side version will rendier it on the page, if you lok at the source coed after running it.)
|
|
|
|
|
thanks for ur help.
but if i put it in page load, firest open the pop up and then run the othe code that are in button1_click. but i want run the code and then open the window.
protected void Button1_Click(object sender, EventArgs e)
{
a = 1;
Session["a"] = a.ToString();
Response.Write("function d(){windows.open
('Default2.aspx', 'kk', 'width:400;height:150;scrollbars:no');},");
}
|
|
|
|
|
element.style.color using this iam able to change only one cell color how can get the change entire row color
|
|
|
|
|
In the RowDataBound event, you can format an entire row like this:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if( < some boolean statement here > )
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
}
}
|
|
|
|
|
wat u gave is right sir but i want this to in javascript becoz element.style.color i wrote in javascript
|
|
|
|
|
The GridView outputs a html table to the browser so if your javascript is changing the colour of one cell then you are accessing the <td> tag, you need to access the parent <tr> to style the entire row.
|
|
|
|
|
I would like to configure VS to use a remote IIS server for debugging a .NET 3.5 web application. How do I do this?
Everything I find on the web claims that I just have to set some properties in the project configuration under the debugging tab to point to the right server. However, there is no Debugging tab. Under the Web tab, I only seem to be able to specify a local IIS server, not a remote one.
I also found one guide that said VS will automatically publish/deploy my application before debugging. This would be very useful but I also do not have a Deployment tab which this guide referred to.
I assume these guides were for VS2005 or earlier? They did not specify. How can I accomplish what I want? Ideally, VS would also publish the application before opening it for debugging.
(Search keeps giving me the "No error" error, so my apologies if this is an often-asked question)
|
|
|
|
|
iam having a text box with multiline property now i want the second line is alway sto be hiligthed. how could be possible
|
|
|
|
|
As i think it is not possible in textbox , you can try with RichTextBox.
Because in textbox , it contain same property for all chartacter as NotePad,
|
|
|
|
|
Abhijit Jana wrote: Because in textbox , it contain same property for all chartacter as NotePad,
What do you mean ?
|
|
|
|
|
What ever font or color or font style you apply to a Notepad it will be same
for conatin of that file, you cant use multiple color to differ character in Notepad
and this is the concept of TextBox.
If you thing about wordpad , it has same features of RichTextBox, as you can apply multiple color
style for differt line etc...
Please Correct me if I am wrong !!!
Thanks
|
|
|
|
|
Abhijit Jana wrote: you cant use multiple color to differ character in Notepad
and this is the concept of TextBox.
Ohh you mean that. It was not giving clear idea, Yes you are correct, a normal textbox is used for showing/entering plain text.
|
|
|
|
|
Could any one please tell me how to insert multiple values into a single column i want structure something like this
JobNumber SupplyParts
J001 Tyres
Mirrors
Bonnets
Rear Bumper
J002 Side Bumper
Bonnet
Seat Cover
Please tell me how to insert values into the column JobNumber and SupplyParts with a single insert statement where column SupplyParts will have multiple rows and at the same time JobNumber value will be only One.
Currently iam inesrting values like this
string InsertName = "insert into ComplaintSupply" +
"(JobNum, SupplyParts)"
+ "values('" + this.txtSupplyParts1.Text + "'),('" + this.txtSupplyParts2.Text + "'),('" + this.txtSupplyParts3.Text + "'), ('" + this.txtSupplyParts4.Text + "'),('" + this.txtSupplyParts5.Text + "')";
MySqlCommand command = new MySqlCommand(InsertName, ComplaintSupply.con);
ComplaintSupply.dComplaintSupplyAdapter.InsertCommand = command;
//Insert New Record.
ComplaintSupply.dComplaintSupplyAdapter.InsertCommand.ExecuteNonQuery();
In the above code i am inserting multiple rows for SupplyParts column from different 5 textboxes but iam not getting how to insert value for JobNum column taking value from some other text box say txtJobNum.
Any help will be greatly appreciated. I am new with database and could not able to solve this issue from last 1 week
Thanks in Advance
Imran
|
|
|
|
|
Hi
Your problem is more SQL related than ASP.NET related. I'd post this in the SQL forum. Also, don't build up SQL strings by concatonation. You are wide open to SQL Injection Attacks[^]
Small angry dogs
|
|
|
|
|
By default I have 10 rows of dynamically created controls on Page Load. After entering Data, When i click Submit button, only rows in which data entered should be inserted into the database.
I am inserting records based on the table rows count. So, it inserts 10 records even if values are not entered.
protected void btnSubmit_Click(object sender, EventArgs e)
{
int j = tblRunTime.Rows.Count;
for (int c = 0; c < j; c++)
{
string query = " INSERT INTO Time VALUES( ";
query = query + " '" + Request.Form["_dr1" + c.ToString()] + "', ";
query = query + " '" + Request.Form["_dr2" + c.ToString()] + "', ";
query = query + " '" + Request.Form["text1" + c.ToString()] + "', ";
...
query = query + " '" + Request.Form["text8" + c.ToString()] + "', ";
query = query + " '" + f_date_b.Value + "'";
query = query + " )";
}
So, how i can solve this?
Can anyone please help me?
Thanks & Regards,
Radha
|
|
|
|
|
In this, you are not checking the value is entered or not. And your controls are dynamically created on page_load, which don't have a viewstate maintained. So you won't get values for those controls. Consider creating it in some other event like (Init). Also read about SQL Injection attacks.
|
|
|
|
|
But, I can get values for those controls. If i enter Data for 2 rows and click Submit button, 2 rows will be inserted with the entered values and the remaining 8 rows will be inserted with null values. I dont want that 8 rows to be inserted.
Thanks & Regards,
Radha
|
|
|
|