Hi Andla,
This is Rajaram.
As per my understanding u want to create server controls dynamically.
But in first method u have created client side control by using
statement :
repl=repl.Replace("[button]","<INPUT type=\"button\" id=\"btn\"
value=\"Button\">");
This will always works fine, since it process string and give code to
client and this string contains plain HTML code which can be dispalyed
by client browser, but now u want to display server control, If u used
same way to display server control , It will generate output string
which looks like server control code but since this code is already
transfered to client browser and client browser can not recognise this
code and display it as plain HTML code,
To avoide this proble u need to create ur own server control which
accpts string and create all dynamic server contorls.
To generate server controls pls don't use replace method ,
break input string and use if then conditions to add server control
For eg:
It is not actual code but u can understand what u have to do:
If Instr(yourstr,"[Button]") <> -1 then
button_pos = Instr(yourstr,"[Button]")
content_before_button = left(yourstr,button_pos)
content_after_button = left(yourstr,button_pos+ 8) ' 8 is used as length
of string "[Button]"
Response.write content_before_button
' and here is code to display server side button
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 92px; POSITION:
absolute; TOP: 54px" runat="server" Width="207px" Height="39px"
Text="Button"></asp:Button>
Response.write content_after_button
I think this will work fine .
But still u have any queries contact me.
Email me at
mh************@hotmail.com .
Regards,
Rajaram Mhadgut :)
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!