|
Nope, didn't work. Also tried the PreInit event, but then the asp:Table hasn't been created yet and when adding rows it throws a null exception.
Thanks for your answer.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Hmmmm, It's very strange because I don't see a problem. In fact, I just did a quick little test and this code worked just fine. And of course it still works fine with Page_Init as well. You've got to have something outside of what you've posted that is effecting the table.
protected void Page_Load(object sender, EventArgs e)
{
TextBox txtTest = new TextBox();
txtTest.ID = "testText";
txtTest.Text = "Hello World!";
TableRow row = new TableRow();
TableCell cell = new TableCell();
cell.Controls.Add(txtTest);
row.Cells.Add(cell);
tblTest.Rows.Add(row);
}
protected void btnShow_Click(object sender, EventArgs e)
{
TextBox txtTemp = tblTest.Rows[0].Cells[0].FindControl("testText") as TextBox;
lblShow.Text = txtTemp.Text;
}
|
|
|
|
|
Yep, I know. The only thing I can think of is that the IDs are generated dynamically as well just after creating the instance of the control. I'll keep reviewing to see what could it be.
Thanks again!
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Well, it's solved. My mistake. The method that created the table was being called from the Page_Load method... if it wasn't a postback. That is, something like.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CreateTable();
}
}
Just removed that and it works as it should be, as in your example above. *goes and sits in a corner ashamed*
Thanks for your help again!
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
|
Umm...
First of all C# code runs on the asp.net server, not the client.
Can you open the file if you save the file disk then click Open?
If not then there isn't anything you can do about it in your web application. You should really see what add-in is causing the problem. Once you have that figured out try googling to get more info.
I didn't get any requirements for the signature
|
|
|
|
|
Hi
Please help me in this regard.How to keep more than one wsdl classes in the same solution.
Thanks in advance
|
|
|
|
|
put the classes in different namespaces
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
how can I show a confirm window with "OK" and "Cancel" buttons and retrieve which button is clicked in ASP.Net 2.
It seems be in javascript, but I don't know about it.
I want to appears the window when clicking an ASP.Net button.
Best wishes
|
|
|
|
|
|
<br />
lnkButton.Attributes.Add("OnClick", "if(!confirm('Are you sure?')){return false;}__doPostBack('" + lnkButton.ClientID + "');");<br />
<br />
lbRemove.Click += new EventHandler(lnkButton_Click);<br />
<br />
protected void lnkButton_Click(object sender, eventargs e)<br />
{<br />
<br />
}<br />
<br />
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
In pageload event, add attributes to the button using the following code.
Button1.Attributes.add("Onclick","return callconfirmation()");
In the aspx page, in between the head tages
write the javascript function with the name callconfirmation.
function callconfirmation()
{
if(confirm("Are You Sure You want to close the application"))
{
window.close();
}
else
{
return false;
}
}
Try the above code and let me know if you have any issues.
Bhanu
|
|
|
|
|
Hi All,
I am using a datagrid in a ASP.NET page.
The data grid is inside a div tag.
<div id="divEditProjectRes" style="OVERFLOW: auto; HEIGHT: 150px">
<asp:datagrid id="dgEditResource" runat="server" Width="100%">
There is edit option in each row of the data grid and the user can edit on a few fields.
The grid has many records and the user has to scroll down.After scrolling to the record and clicking on edit there is a post back ,and the grid is set back to the top and he again has to scroll back to the row in which now fields are editable.
What I want here is that after he clicks on edit the same row must come at the top and the user need not scroll it again.
I have used the following code in dgEditResource_EditCommand to set focus to the editable text box in the particular scroll row ,Although it gets the focus but again we need to scroll down .
Dim descTB As TextBox
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("sdate_edit")
'Set the script to focus and select the TextBox
RegisterStartupScript("focus", "<script language=""JavaScript"">
vbTab & "Form2." & descTB.ClientID & ".focus();"
vbCrLf & vbTab & "Form2." & descTB.ClientID & ".select();" & "<" & "/script>")
descTB = dgEditResource.Items(e.Item.ItemIndex).Cells(2).FindControl("percent_Edit")
If we press tab or space bar the record comes up as focus is already in the text box.
But I need that row to scroll up or navigate by itself after edit is clicked.
Thanks in advance.
Regards,
Sakshi
<div class="ForumMod">modified on Saturday, January 26, 2008 7:47:32 AM</div>
|
|
|
|
|
How to generate data in dropdownlist using database wizard?
Coding of Database Programming we usually follow the rules. connection,command,adapter and dataset respectively. This is only for coding. What if I will use this using the wizard, I mean no coding will happen, all are in wizard scenario. I tried already but unfortunately it will not populate the data into dropdownlist.
What I did is in the dropdown property, I set datamember, datasource, datatextfield and datavaluefield.
Note all objects are already set in properties.
Is anybody here have done this scenario. Could someone help my problem. Thanks in advance.
jeof
//------------------------------------
//Software is like a sex;
//It's great when it's free. C#Coudou
//------------------------------------
|
|
|
|
|
var doc = new ActiveXObject("Word.Application"); // creates the word object
doc.Documents.Open("C:\\My Documents\\file.doc"); // specify path to document
var txt;
txt = doc.Documents("C:\\users.doc").Content;
alert(txt);
i am getting error automation server cannot create object .
can anyone help me .
|
|
|
|
|
This is because of one of the following issues:
* The client machine (where you are running now) does not have MS Word.
* Internet Security restricts the browser to use that ActiveXObject.
|
|
|
|
|
microsoft word is there on my machine. and for the second one what should be done. is there any other way to read a word file in javascripting.
|
|
|
|
|
For the second one, go to Component Services and find the MS Word component. Then set the permission.
I too had this problem in my company few months before. But this permission issue it not settlement even after setting up the permission. Atlast we used ActiveXObject to do whatever we want.
Google for more inform. All the best.
|
|
|
|
|
Hi All,
I am developing a web site in English language. i need in a certain page to enter for example name in different language with direction left to right where the direction in all textboxes is from right to left. Also i need to change the language. Is that possible? thanks
|
|
|
|
|
Hi
I have a problem with a website. Through my machine and through IE and FF I can view a new piece of text which has been uploaded to the website via a different machine.
However on our other machines in the company you cannot see the new bit of text
can any1 shed some light on this?
cheers
|
|
|
|
|
Hi;
Here is a wild guess.
Could it be a firewall restriction on your company's intranet ?
Try investigating this first.
Good Luck
|
|
|
|
|
hi all
I need validator file upload
only file gif,jpg,png if orther file have messbox error
|
|
|
|
|
Get it
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I am having a dropdownList and when i select different items from the dropDownList with respect to the selected ITem the details are loaded to the GridView and in GridView properties AutoGenerateEditButton="true"
Can someone pls help me what code should be written in rowediting event and rowCancelEdit event
EXAMPLE
LET DROPDOWN LIST HAVING 3 TEXTS
1.RENEWAL INVOICE
2.QUOTATION INVOICE
3.RECEIPT INVOICE
WHEN I SELECT QUOTATION INVOICE THE DETAILS THAT WILL BE DISPLAYED IN GRIDVIEW.
THE GRIDVIEW DISPLAY IS AS FOLLOWS
PLAN TYPE FIRST NAME LAST NAME ID
Edit Delete Premium 1 Year Robin Simon 575003
Edit Delete Individual 2 Year Pradeep Bhojwal 575004
I WANT TO EDIT THE DETAILS IN THE GRID ITSELF WHEN I CLICK THE EDIT BUTTON THERE IN THE GRIDVIEW
WHAT I NEED IS THE CODE THAT IS TO BE WRITTEN IN THE
RowEditing event and
RowCancelingEdit event and
RowUpdating event of the DATAGRID
pls reply as soon as possible
its so urgent
waiting for ur reply
Regards
Robin
|
|
|
|
|
robinsimon_m wrote: WHAT I NEED IS THE CODE THAT IS TO BE WRITTEN IN THE
No one is going to give you the code, simply because you are too lazy/incompentent to write it yourself. If software development is too difficult for you, maybe you should consider switching to a career more befitting to your intellectual capabilities. My local McDonalds is currently hiring - maybe you should give them a ring.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|