[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

can I use C# "if" statement in an ascx file?

(Dazhi yang)

12/25/2002 3:31:00 PM

Hi experts, i'm developing mobile UI based on a PC version of it. now
i've seen examples from older version of asp and VB that you can
simply use
<% If Not IsPocketPC then %> do this and that <% End If %>
in a .asp file. now my question is can i do something similar to this
in
my aspx or ascx file? i'm using asp.net and my ascx file is seperated
from
the .cs file. this will save me time to create panels and try to
control the layout from the cs file behind.
any advice is greatly appreciated!

regards,

dazhi
1 Answer

Baccarin

11/10/2002 7:50:00 PM

0

Hi Dazhi,

I'm not an expert, but I believe that these samples can be the
starting-point for your research.

In aspx files:

<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isPocketIE">
<HeaderTemplate>
<asp:TextBox id="textBox1" runat="server" text="I am inside isPocketIE
filter" />
</HeaderTemplate>
</Choice>
<Choice>
<HeaderTemplate>
<mobile:TextBox ID="textBox2" Runat="server" text="I am inside another
filter" />
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>


In your code:

HttpBrowserCapabilities brw = this.Request.Browser;
txtTeste.Text = brw.Browser; // ... for example


Regards,

Baccarin.


"Dazhi yang" <gt9988b@yahoo.com> escreveu na mensagem
news:95eac9c8.0211081138.44c3ea9f@posting.google.com...
> Hi experts, i'm developing mobile UI based on a PC version of it. now
> i've seen examples from older version of asp and VB that you can
> simply use
> <% If Not IsPocketPC then %> do this and that <% End If %>
> in a .asp file. now my question is can i do something similar to this
> in
> my aspx or ascx file? i'm using asp.net and my ascx file is seperated
> from
> the .cs file. this will save me time to create panels and try to
> control the layout from the cs file behind.
> any advice is greatly appreciated!
>
> regards,
>
> dazhi