|
Vicky, this sounds bizzare... although I had issues too when I would point to a javascript file instead of embedding it within the HTML. If you only want an alert box, then do this:
In your child page, add the following line within the Page_Load event:
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
...<br />
<br />
if (!Page.IsPostBack)
{<br />
this.Button1.Attributes.Add("onclick", "alert('any message can go here...');");<br />
}<br />
}
This would be a simple way to do alert. Try and see if it works, if not, send your source code to me NightHawk13@hotmail.com (if you feel comfortable doing so) and I will try to correct your code.
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
Hi Vicky,
Your best bet as far as learning how to implement and work with ICallbackEventHandler interface is to look up msdn2: http://msdn2.microsoft.com/en-us/library/system.web.ui.icallbackeventhandler(VS.80).aspx
There are many other developer sites, including codeproject, where you can get real-life examples of ICallbackEventHandler implementation. However, when you are doing your research, make sure to look up only those that have implemented TWO methods associated with this interface void RaiseCallbackEvent(String eventArgument) and String GetCallbackResult() Some examples are from 2.0 beta and have only one method.
Here is a good code example: http://msdn2.microsoft.com/en-us/library/ms366515(vs.80).aspx
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
see if you accessing a textbox with id like txtName
then better user of
document.getelementById('<% txtName.clientId %>').value
it will work with your master pages.
|
|
|
|
|
You can also check the Id of your controls in run-time clicking on viewsource.
Eric H.
|
|
|
|
|
Hello,
Everytime I try to use the ReportView on a web app. I get the same error over and over. "A data source instance has not been supplied for the data source 'dsReport_Contact'."
Weather I setup the data source for the report using code or the designer I keep getting this error. I've tried to use the smart tag for the report viewer control. I click the 'Choose Data Source' link and get the dialog. I then browse the 'Data Source Instance' drop down. But once I select the table 'Contact' from my DataSet. Visual Studio bombs out.
Any help would be great. Thank you.
|
|
|
|
|
hi to all
What is the difference between IsPostBack and Not IsPostBack
thanx
regards
saravanan
|
|
|
|
|
Page.IsPostBack property
Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
MSDN is your friend
only two letters away from being an asset
|
|
|
|
|
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);
|
|
|
|