|
Pankaj Garg wrote: But how can i define the funciton using the ajax to do the same.
can you explain in details that what you are trying to do ??
|
|
|
|
|
can i write the fucntion in the source file , in order to do the editing in the gridview .
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Function will reamin in the same source file, just put the Gridview inside the update panel, if it take much time to retrive or update date use UpdateProgressbar !!!
|
|
|
|
|
do u have any link , that pertains to very basic free ebook for ajax (covering all topics.)
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
|
Hi,
I have an ASP.Net application and I have enabled the above two properties on my page. Everything works fine on every OS-Browser combination, but on Windows 2000, with IE5,
1. As soon as the page opens up, I get a JavaScript error "Object doesn't support this property or method". I identified the problem is because of enabling MaintainScrollPositionOnPostBack, which tries to change the submit property of the page: I set the property to false and all works fine even on IE5
theForm.submit = WebForm_SaveScrollPositionSubmit;
2. The page implements ICallbackEventHandler, and has script callbacks at various intervals on the page. When the page submits, I get the error "Invalid Postback or callback argument...use ClientScriptManager.RegisterForEventValidation in order to register the postback or callback data for validation"
As I said, this problem only occurs on IE5, but I searched around and there are not a lot of people complaining about this.
Has anyone else faced this problem with IE5 before, or can I avoid this problem somehow?
Thanks,
Praveen
There has to be more to life than just this
|
|
|
|
|
I have an AJAX page inside this I have tree control and when I use the RegisterArrayDeclaration(System.Web.UI.Page, System.String, System.String) to register an array it gives me the followign error:
Method not found: 'Void System.Web.UI.ScriptManager.RegisterArrayDeclaration(System.Web.UI.Page, System.String, System.String)'
Can any one tell me how to solve this?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi all,
I just want to add several controls at runtime like dropdown list, text box abd button. And, when we click the button again one row will be added with the set of controls likewise.can anyone please help me?
Thanks in Advance.
Thanks & Regards,
Radha
|
|
|
|
|
To add controls dynamically, create the control objects in code and then add them to the Controls collection for the current page.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Step1:
Add one panel to your page.
Step 2:
Create object of your Control
Button B=new Button()
Step 3:
Add properties that you need ....
like
B.Name="Test Button"
B.ID="Button1"
B.Text="Click Me"
Step 4:
Add Event Handler with the Control
B.Click+= new System.EventHandler(Button_click)
Tricks : After Write B.Click += Press TAB again TAB.... next part and Function body will create automatically
Step 5:
Add the control to your page
panel1.controls.add(B)
Step 6:
write function for Button_click
procted void Button_Click(Object Sender, EvnetsArgs e )
{
}
Steps 7: Run....
|
|
|
|
|
Thank You, Abhijit.
I can create controls now. The thing is i have to create ten rows of controls(dropdownlist,textbox) when the page loads and if i want to add more rows i can add by clicking a button. And, i need to load Dropdownlist values from database. Please help me.
Thanks & Regards,
Radha
|
|
|
|
|
Radha27 wrote: The thing is i have to create ten rows of controls(dropdownlist,textbox)
Is each row will contain Dropdown list and text box ???
if yes, then create a function the will generate one DropdownList and Textbox , Call that 10 times at form load and you can call the same on button click.
If it is not clear, then just give me the breif idea that what you are trying to do !!!
I will surely help you, if i Can !!!!
|
|
|
|
|
Thank you Abhijit.
Let me explain my scenario.
Basically this is for one application's Data Entry form.Each row will contain 2 Dropdown lists and 8 textboxes.10 rows shuold be loaded by default i mean at form load and a Addmore button will be there. If i want to add more data, additional rows will be added by clicking Addmore button.
(Dropdown list values shold be loaded from database.)
Can u help me?
(And i tried like what u have explained in ur previous post. But it doesn't work. Only one row is being loaded.)
Thanks & Regards,
Radha
|
|
|
|
|
> Create Runtime Table to maintain the allignment
>> Add Dropdownlist and Textbox inside each
[ That will create also in runtime ]
MAke this thing inside a function !!!
you have to use Table , Dropdownlist , and Textbox Classes Object . And it should be Array of Object !!!!
>>> Add Event Handler when you required !!!!
>>>> For Database Data, When you create the Dropdown list , use D.Items.Add() on that function itself.
>>>>> And on Button Click Call the same Function .....
--------------------------
For your reference!!
Dynamic Array of Button[^]
--------------------------
This will just add one row with that table..........
This is the simpliest IDea ....
One more idea ..... that you can create one Custom Web user control ....(ascx) file......
>>>>>>>
Regarding The Tricks ::: It was not about adding Column or anything else...
This is the .NET general Trick !!!!
e.g
when your write a if statement ....if have to write
if(condition)<br />
{<br />
{<br />
else<br />
{ <br />
}
Now just try this..
write if and press TAB
Check what the difference,similarly try with switch, for, while statement . and where i am talking there it will do the same thing...
----
Check my latest article ....
|
|
|
|
|
Abhijit, Please check the code shown below and help me;
for (int i = 0; i < 10; i++)
{
Text1[i] = new TextBox();
//b[i].ID = i; //Can use ID
Text1[i].ID = "Text1" + i.ToString();
Text1[i].TextMode = TextBoxMode.MultiLine;
c1.Controls.Add(Text1[i]);
}
Here, i tried to add the text box to Table cell c1.
But, i dont get the result.
Did i miss anything here?
Thanks & Regards,
Radha
|
|
|
|
|
Radha27 wrote: Did i miss anything here?
Did you add the table inside the page ?
|
|
|
|
|
Yes, i do.
Table tblData = new Table();
TableRow r = new TableRow();
TableCell c1 = new TableCell();
...
c1.Controls.Add(Text1[i]);
r.Cells.Add(c1);
tblData.Rows.Add(r);
Thanks & Regards,
Radha
|
|
|
|
|
where did you added the Table into page????
use
this.Control.Add(tblData);
if still problem let me know or if you solve then also inform me !!!!
|
|
|
|
|
Sorry i have a panel and add that table to panel.
Panel1.Controls.Add(tblData);
But still it doesn't work.
Thanks & Regards,
Radha
|
|
|
|
|
ok, then wait for few minutes,,,, and let me do this ....!!!!
|
|
|
|
|
Thanks a lot.
Thanks & Regards,
Radha
|
|
|
|
|
In Designed View Dragged and Drop a ASP.NET TAble Control From ToolBox
-----
Changed The ID : tblRunTime
--------------
Copy this code to page load !!!!
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
for ( int i = 0; i < 10; i++ ) <br />
{ TableRow tr = new TableRow(); <br />
TableCell td1 = new TableCell(); <br />
DropDownList _dr = new DropDownList();<br />
_dr.ID = "lbl" + i.ToString();<br />
_dr.Items.Add("DropDownList " + i.ToString()); <br />
td1.Controls.Add(_dr); <br />
TableCell td2 = new TableCell(); <br />
TextBox _text = new TextBox(); <br />
_text.ID = "TextBox " + i.ToString(); <br />
td2.Controls.Add(_text); <br />
tr.Cells.Add(td1); <br />
tr.Cells.Add(td2);<br />
tblRunTime.Rows.Add(tr);<br />
}<br />
}
---
Run It..........
------
--------
Check my latest Article in codeproject !!!!
Let me know when done !!!!
|
|
|
|
|
Hope this is now working for you !!!
|
|
|
|
|
Thanks a lot.
Its working now.
Thanks & Regards,
Radha
|
|
|
|
|