Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET iPhone HTML5
I am working on an asp.net webapp for the iPhone. When I first started the app on my iPhone it looked fine but after a few minutes, and since then, all the controls on the page are very small although I specified sizes. Re-uploading the app to my server didn't solve the problem - which only occures on the iPhone.
 
This is one of the buttons for example: <asp:Button ID="Button1" runat="server" Font-Size="12" OnClick="Button1_Click1" Text="Upload" Height="39px" Width="82px" />
 
This is how it looked at the beginning: http://i1168.photobucket.com/albums/r493/washingtion1/2_zps92546931.png[^]
This is how it looks now:
http://i1168.photobucket.com/albums/r493/washingtion1/1_zps82eb6d13.png[^]
Posted 26-Sep-12 5:07am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It seems, you have dragged the controls and that gets your css file affected.
 
Can you have a quick look into the stylesheet. Probably you have some input class that gets affected.
 
Let me know, if this solves.
 
cheers
  Permalink  
Comments
Member 7682309 at 26-Sep-12 16:40pm
   
Where do I find the stylesheet? What should I look for in it?
Sandip.Nascar at 27-Sep-12 1:03am
   
Could you have a look that in asp page, you have any reference to stylesheet (.css)? If no stylesheet reference exists, then the problem is different. Let us know.
Member 7682309 at 27-Sep-12 1:36am
   
I have checked it and there is no reference to a CSS stylesheet.
Sandip.Nascar at 27-Sep-12 1:40am
   
Did you used any theme? Could you please have a look, if the page is inherited from master page. If yes, check any css reference in master pages as well. This is definitely something related to css or inner style which gets updated automatically.
 
Also, have a look in the page itself, if there is any <style></style> tags.
Member 7682309 at 27-Sep-12 1:46am
   
No reference to a CSS stylesheet or <style> tags in the master page.
Member 7682309 at 27-Sep-12 12:43pm
   
Actually I figured out the server adds a <style> tag when adding the "Web host by somee.com" link at the bottom of the page. How can I solve my problem in this case?
Sandip.Nascar at 27-Sep-12 12:48pm
   
There must be something in the style tag which makes the input control smaller. If you cannot figure it out, you delete the style for inpur or post the content within the style tag here.
Member 7682309 at 27-Sep-12 15:17pm
   
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
<link rel="apple-touch-icon" href="spy icon.png"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-startup-image" href="splash.png"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Spy
</title>
</head>
<body style="font-size: 12" background="ios%20back.jpg">
<form method="post" action="login.aspx" id="form1" aria-orientation="horizontal" aria-setsize="12" aria-relevant="all">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUIOTk0MDU0NTVkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBSNjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJENoZWNrQm94MVdwVDqMPUXWSnRNZPmehfJlyvZBnpuMcgNzXMuDA8pn" />
</div>
 
<div class="aspNetHidden">
 
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLk2LugDgLc3uCnBALc3tSnBAL+zqO2BAKA4sljSUTPnVsqQ6yfr8zDHKzB6J4gVGczm3LKn9zxryCtLlM=" />
</div>
<div>
<img id="Image1" src="Invex%20Spy%20Title.png" style="height:50px;width:300px;" />
<br />

<p>
</p>
<span id="ContentPlaceHolder1_Label1" style="color:White;font-family:Arial;">Username:</span>
   
<input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ContentPlaceHolder1_TextBox1" style="font-size:12pt;" />
<br />
<span id="ContentPlaceHolder1_Label2" style="color:White;font-family:Arial;">Password:</span>
   
<input name="ctl00$ContentPlaceHolder1$TextBox2" type="password" id="ContentPlaceHolder1_TextBox2" style="font-size:12pt;" />
<br />
<br />
<span style="color:White;font-size:12pt;"><input id="ContentPlaceHolder1_CheckBox1" type="checkbox" name="ctl00$ContentPlaceHolder1$CheckBox1" /><label for="ContentPlaceHolder1_CheckBox1">Remember me</label></span>
<br />
<br />
<input type="submit" name="ctl00$ContentPlaceHolder1$Button1" value="Login" id="ContentPlaceHolder1_Button1" style="font-size:12pt;height:100px;font-size: 12" />
 
</div>
</form>
</body>
 
</html><!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->
Web hosting by Somee.com

</textarea></xml></script></noframes></noscript></object></style></title></applet>
<script language="JavaScript" src="http://ads.mgmt.somee.com/serveimages/ad2/WholeInsert4.js"></script>
<!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->
Member 7682309 at 27-Sep-12 15:19pm
   
This is the login page. As you can see the server adds a banner at runtime (I don't see it when I open the file on the server - only when I navigate to it and click on 'View Source').
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

OK - When I looked at the page source I noticed that a style property was added to every control on the page. I was able to fix my problem by adding the same style property to my original code.
(By the way, I still don't understand why my solution works exactly.)
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid