Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 937
  • Last Modified:

Problem adding control in ASP.NET Mobile Web Application

I am developing an ASP.NET Mobile Web Application  for the first time.
I am trying to add controls in the form control. I can add only one control in one line. I tried adding the textbox, it has a border to it which I can't resize. Does this mean, I cannot align or resize controls.

Where can I find more documentation and sample codes for ASP.NET Mobile Web Applications

Thanks
0
wilkersons
Asked:
wilkersons
  • 11
  • 9
1 Solution
 
Bob LearnedCommented:
Mobile Controls (Text Control):
http://www.dotnet247.com/247reference/msgs/12/63852.aspx

Extract:
Since most mobile devices do not support multi-line text boxes, we did not
include a multi-line text box control. You can make use of the device
specific construct to send down a standard ASP.NET multi line text box down
to the Pocket PC browser.

Bob
0
 
wilkersonsAuthor Commented:
Thanks for the helpful link.

Actually what I need is a way to align controls side by side.
Like a
                     _________________
Name(Label)  |_________________|   (textbox)


Thanks again
0
 
Bob LearnedCommented:
AFAIK, it is not possible, but it may be because I haven't figured out that one magic piece.

Bob
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
wilkersonsAuthor Commented:
I have developed a website for desktop PC using ASP.Net and this is the first time I have to develop a website for the smart phone users. Since you are an expert in this field, can you suggest some good links to examples or sample code for ASP.Net mobile web appliaction.

Is there anything else I need to know before I start the application development.

Thanks for your help.
0
 
Bob LearnedCommented:
I wouldn't say I was quite an expert, yet.  Mobile applications are similar to ASP.NET web applications, but I am slowly discovering just how different they are.


These are the links that I keep around:

Building Mobile Web Applications with .NET Mobile Web SDK & ASP.NET:
http://www.wirelessdevnet.com/channels/wap/features/mobilesdk.html

Developing Mobile Web Application with .NET:
http://www.c-sharpcorner.com/Mobile/MobileAppsInNETGAG01.asp

Windows Mobile:
http://www.microsoft.com/windowsmobile/default.mspx

Mobile Web Application Architecture flash presentation:
http://www.asp.net/mobile/flasharchitecture.aspx?tabindex=6

If I find any others, that are useful, I'll just keep adding to the list.

Bob
0
 
Bob LearnedCommented:
What kind of device are you designing for?

Nokia Mobile Internet Toolkit 4.1
http://www.forum.nokia.com/main/0,6566,034-13,00.html

Bob
0
 
wilkersonsAuthor Commented:
Thank you so much for the links. I'll do some more R&D and will let you know.

BTW: I am developing app for Siemens SX66  phone.

Thanks
0
 
Bob LearnedCommented:
I'll be interested to see what the next version of Visual Studio.NET brings into this arena, because it seems very limited to me, although it does make sense, since the mobile devices that you try to interface with are limited in size and functionality (for now).

Bob
0
 
wilkersonsAuthor Commented:
Hi Bob,
I am trying to add an HTML button in the FORM CONTROL on the mobileform.aspx because I want to add a Print button with the following code :

<INPUT language="javascript" id="btnPrint" style="Z-INDEX: 111; LEFT: 648px; WIDTH: 88px; POSITION: absolute; TOP: 104px; HEIGHT: 24px" onclick="javascript:window.print()" type="button" value="Print" name="btnPrint">

and it is giving the error that Non-mobile controls are permitted inside templates only.

I tried adding a datagrid and it gave the same message.

Do you have any suggestions as I need to print the webpage.

Thanks

0
 
Bob LearnedCommented:
Procedure:

(1) Drag/drop DeviceSpecific control from the Mobile Web Forms tab and drop on the form.

(2) Right click on the control, and select 'Templating options...'.

(3) On the 'Templating Options' dialog, click the <Edit> button.

(4) Select 'isHTML32' from the 'Available Device Filters' drop down.

(5) Click on <Add to List>.  Click on <Ok>.

(6) Back on the 'Templating Options' dialog, select the new 'isHTML32' filter from the 'Applied Device Filter' drop down.

(7) The markup schema should say 'Mobile HTML 3.2 Template'.

(8) Click on <Close>.

(9) Switch to the HTML design view for the page.

(10) Find this line in the HTML:
     
      <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template"></Choice>

(11) Insert a new line at the closing tag, so that you get this:

      <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template">
      </Choice>

(12) Type <HeaderTemplate> and </HeaderTemplate> closing tags:

      <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template">
           <HeaderTemplate>
           </HeaderTemplate>
      </Choice>

(13) Copy the text for the INPUT button to the clipboard.

(14) Move the cursor between the <HeaderTemplate> and the closing </HeaderTemplate> tags.

(15) Paste the text in between these two lines, using the Edit | Paste as HTML option:

      <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template">
            <HeaderTemplate>
                <INPUT language="javascript" id="btnPrint" style="Z-INDEX: 111; LEFT: 648px; WIDTH: 88px;
                 POSITION: absolute; TOP: 104px; HEIGHT: 24px" onclick="javascript:window.print()"
                type="button" value="Print" name="btnPrint">
            <HeaderTemplate>
      </Choice>


Try that.

Bob
0
 
Bob LearnedCommented:
Another one for the list:

Device-Specific Content:
http://samples.gotdotnet.com/MobileQuickStart/(rklyaqbingdri3uzkqx54l45)/doc/DeviceSpecific.aspx

Look the Templates and Template Sets example.

Bob


0
 
wilkersonsAuthor Commented:
When I tried
<Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template">
            <INPUT language="javascript" id="btnPrint" style="Z-INDEX: 111; LEFT: 648px; WIDTH: 88px;
              POSITION: absolute; TOP: 104px; HEIGHT: 24px" onclick="javascript:window.print()"
              type="button" value="Print" name="btnPrint">
      </Choice>

I am getting the error at  INPUT:
Per the active schema, "INPUT' must be included inside the parent element.

Any idea whats causing that??

Thanks for the link for templates.

0
 
Bob LearnedCommented:
Sorry, forgot the <HeaderTemplate> and </HeaderTemplate> tags.  

I edited the original comment in order to keep this question from getting way too long.  So ask, if there are any questions.

Bob
0
 
wilkersonsAuthor Commented:
I appreciate all ur help for guiding me in the right direction.

Well, now I am getting the button and its also printing. But the browser is displaying this button on the right(outside the device screen area) whereas the other mobile controls in my form are on the left.
I tried to move the button in the panel control but its giving the error that : the active schema doesnot support the element  'HeaderTemplate'??
0
 
wilkersonsAuthor Commented:
Is this the right way to print the webpage on the mobile device??..I mean using  javascript ..or I should use an active X.

In the regular ASP.NET application which I developed, I had used the meadroid activex control which has more functionality. Again I am not sure how to use that here, will it work in this scenario..??
0
 
Bob LearnedCommented:
Go back to the HTML view, and modify the style for the button, and change from LEFT: 648px to  LEFT: 0px

Bob
0
 
Bob LearnedCommented:
BTW, I always ignore the 'active schema doesnot support the element'  warnings in HTML view, because they are useless as far as I am concerned, because everything still works.

Bob
0
 
wilkersonsAuthor Commented:
Wow!! U R great!!

Thanks a lot.
I have few other questions also. Do you want me to continue here or open new ones?? Actually I don't want to loose your valuable guidance.
0
 
Bob LearnedCommented:
I would prefer that you ask another question, otherwise this question will just get too long, and too cumbersome.

Thanks,
Bob
0
 
wilkersonsAuthor Commented:
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 11
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now