views:

96

answers:

2

I have a simple website and I use masterPage for designing my template.

everythings work fine, but when I add a Custom (google) Search Box in it my pages correpted.

infact asp does not support Nested Form and as you all know google use a simple form to get queries from the users.

so at first I redesign my site and put 2 Form in it. One server form for my pages content and one other form for google search box. untill here everything work fine .

so I force to add 2 new button beside of my search box and these buttons need a runat=server form, so now I need an approach that let me enable a third form (second runat=server form ) or find an approach to use simple form inside of runat=server form, actually

howcan I put 2 form inside each other or how could we enable a nested form ?

+2  A: 

Nested forms won't be possible. You'll need to make those buttons work without being in a runat="server" form.

Noon Silk
how to make a asp control work without a runat=server form ?
Nasser Hadjloo
Nasser: If the control claims it needs that, then you can't. You'll just have to not use ASP.NET controls, and use regular HTML ones (then check for the appropriate field to passed back to you, in the 'Request["..."]' map. You can still make it work.
Noon Silk
silky, as you mention, I replace my server control by html equals. the layout issue resolved but the imoportant thing that was calling their methods still remains, this images uses tochange site culture and if I can't call thesemethods, I should find another solution. can you show me a way to call server events by javascripts ?
Nasser Hadjloo
for this I put a HiddenField inside my page and then I implement a onValueChange() of this control, then try to change the asp:hiddenFiled control by javascript, everythings work fine, but because of no postback happen, my code donot work ? any help ?
Nasser Hadjloo
A: 

Cause Asp Forms are not a display control and just accessible in code for programmers,

so I use it in a unregular manner,

as you all know every XML markup like XHTML (asp) have some element (in asp case : control) and each element have its own attribute (in asp case controls properties)

so I just need to put my controls inside the Form (root) Element and cause when page loading on client machine, whenever browser see the server form just change a flag to true (the server form is available) then you can use what ever you have inside of the form,

so if you can lagically put your controls inside of the form , so putit, nothing bad happen )

Nasser Hadjloo