|
Every time that user load or reload a page, he's making a postback (roundtrip to server, client->server->client), Except the FIRST TIME that user load the page (server->client) this condition is call isnotpostback.
You can reach this condition writing this code lines on load Form event.
<br />
if(!ispostback)
{<br />
}<br />
keep Learning and you never will be out of date...
|
|
|
|
|
The Page.IsPostback property is a property you can use to test whether your page is being loaded for the first time or whether it is being loaded as a result of a Postback, meaning that user has done something on the page and caused a reload event to happen.
Hope this helps
|
|
|
|
|
Hi,
I have a chart that renders in HTML, and I need to print it.
The problem is: the chart is too big horizontally, and it does't print it all. So I would like to rotate the page to print it landscape (without the user neet to configure the printer) and also that I could break the chart into 2 pages deppending on the width of the chart.
The thing is: how to print the whole chart? The browser print what is in the screen, but not the rest of it...
Can anyone help me?
Thanks
---
Tiago Dall Igna
|
|
|
|
|
You may want to research CSS and mediatype print. You could use a stylesheet to format your page better for printing.
only two letters away from being an asset
|
|
|
|
|
An alternative is to the GDI+ namespace in .NET (System.Drawing) to dynamically render a jpeg image version of your chart which you could then rotate 90 degrees dynamically rather than have the user do it.
Bear in mind that any dynamic image generation will hammer the server, use it as a last resort and investigate CSS and MediaType print solution first, as Mark Nischalke says. Maybe you could display the the chart normally as HTML with a'show print friendly version' button that links to the dynamically generated one.
|
|
|
|
|
System.Data.DuplicateNameException: A column named 'rating' already belongs to this DataTable. at System.Data.DataColumnCollection.RegisterName(String name, Object obj)
my code iam getting above exception
DataTable dt=new DataTable();
try
{
foreach(DataGridItem dg in DataGrid1.Items)
{
String Name = dg.Cells[0].Text;
DataRow dr;
DataColumn dc;
dc=new DataColumn("rating");
dt.Columns.Add(dc);
dr=dt.NewRow();
dr[0]=Name;
dt.Rows.Add(dr);
DataGrid2.DataSource=dt;
DataGrid2.DataBind();
}
}
catch(Exception ex)
{
Response.Write(ex.ToString());
}
finally
{
conn.Close();
}
|
|
|
|
|
That is because you are trying to add more than one column with the same name.
What is it that you are trying to do?
---
b { font-weight: normal; }
|
|
|
|
|
As Guffy said, a column named 'rating' is already part of your DataTable, and then in your code
dc=new DataColumn("rating");
dt.Columns.Add(dc);
You are adding the same column again to the data table, ofcourse it'll complain.
Good luck
sam
|
|
|
|
|
Hi friends
I have two dropdown list and one check box
both dropdown have same records
when i select item in dropdownlist and then i check checkbox,on checkbox event i want to get same selected item in other dropdowlist.
my code is
DD2.Items(DD2.SelectedIndex).Text = Me.DD1.SelectedItem.Text
Pathan
|
|
|
|
|
<br />
DD2.Items.FindByText(DD1.SelectedItem.Text).Selected = True<br />
|
|
|
|
|
Hi
I want to do it in javascript.
Thanks 4 ur reply
pathan
|
|
|
|
|
try this
var DD1List = document.getElementById('DD1');
var DD2List = document.getElementById('DD2');
var index = DD1.selectedIndex;
DD2.options[index].selected=true;
|
|
|
|
|
Hi rashida
Thanks for ur reply
its work fine
now i want to remove that item when i uncheck checkbox and selected index should be -1 of 2nd dropdownlist.
Pathan
|
|
|
|
|
Hi friends
I want to get value from one textbox to other textbox on oncheckchange event of check box.
i write this script
function getval()
{
if(document.getElementById('CHCK').checked==true)
document.getElementById('TB_2').value=document.getElementById('TB_1').value;
else
document.getElementById('TB_2').value="";
}
CHCK.Attributes.Add("OnCheckedChanged", "return getval();")
But I got no result.
PaTHaN
|
|
|
|
|
replace this
CHCK.Attributes.Add("OnCheckedChanged", "return getval();")
by
CHCK.Attributes.Add("onclick", "return getval();")
Regards
Shajeel
|
|
|
|
|
Dear Concerned,
I want to create a property in my user control which i am creating in Web Control Library. I am using .Net 2003.
My question is that how I can create a property that will contain a dropdown list & will have five values 1,2,3,4,5.
The Programmer will be able to select one of these values at design time in his aspx page.
Please help in the form of code.
Thanks,
Fasih
fasih_is_my_signature
|
|
|
|
|
Not sure what exactly you are looking for, but it sounds like you need to know how to populate a drop down list.
ddl.Items.Insert(0, "--Select--");
ddl.Items.Insert(1, "Value 1 or whatever");
This is how you hard code the values to be displayed, if you want to load 'em dynamically, then use a dataset or something as a datasourse for this drop down list. Look at the code below:
ddl.DataSource = ds;
ddl.DataTextField = "Columns_Name";
ddl.DataValueField = "Column_Name"; // note this won't be diaplayed
ddl.DataBind();
*NOTE : ddl = drop down list
Hope this helps.
sam
Eating, drinking and coding...you can't have it better than that!!
|
|
|
|
|
Hi all i bulding app
i get image but i want it to System.Drawing.Image
System.Drawing.Image b = System.Drawing.Image.FromStream(objstream);
b.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
|
|
|
|
|
Ok... did you have a question also?
---
b { font-weight: normal; }
|
|
|
|
|
Yep, You got a image and ...
keep Learning and you never will be out of date...
|
|
|
|
|
I get a Image by WebService
i use method
System.Drawing.Image b = System.Drawing.Image.FromStream(objstream);
b.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
but Response.OutputStream show is binray i want get to System.Web.UI.WebControls.Image
|
|
|
|
|
Hi,
I have code that fires a stored procedure, to insert a new location.
I now need to add another insert, that inserts a destination into another table, using a trigger.
I pass the following variable to my location table : @LocationCode
I want to create a trigger, that everytime an INSERT is fired on the Location table, it should add a row to my Destination table.
Here is what I have to create the trigger:
<br />
<br />
CREATE TRIGGER DestInsert ON [Location]<br />
FOR INSERT<br />
AS<br />
<br />
INSERT INTO Destination<br />
(LocationCode, Destination, AreaCode, DeletedFlag)<br />
VALUES (@LocationCode, 'New', '123C', 0) <br />
<br />
Will this create a trigger for me, that adds the same @LocationCode variable I added for the stored Procedure to the trigger?
|
|
|
|
|
use..
Inserted.Locationcode
it will fetch the location code from inserted location
enjoy
Dinesh Sharma
|
|
|
|
|
DineshSharma wrote: Inserted.Locationcode
Thanks, just one more thing.
Is Inserted a DB function, or does it gets the last LocationCode inserted?
|
|
|
|
|
It's a table that contains all the rows that were inserted when the trigger was fired.
|
|
|
|