dynamic device specific script

ASP.NET

    Sponsored Links

    Next

  • 1. Printing from PocketIE
    All, We have developed a mobile .net application and the client now wants to print to an IR HP450 printer from PocketIE. Does anyone have any suggestions? It does not appear that printing on PocketPC is well supported!
  • 2. VS 2K3
    Yesterday I installed VS 2K3. So far so good. When I tried to run a mobile project the emulator was launched and there things went wrong. My machine (Win XP SP2) started hanging on the installation of "Virtual PC Application Services". Even with the upgrade to PocketPC 2K3 SDK with Active Sync 3.7, I am experiencing the same problem. The emulators are in the menu of VS but when running everything blocks. When I look in my management console under "System" I can see that the emulators are not well installed. I went to the Connectix site (newsgroup) and found that there can be a problem with their soft and Win XP together with Office XP. Any solutions or people with the same problem?
  • 3. need help in building mobile web application
    I'm trying to develop a web page for both pocket pc and handphone (wap). I've gone thru some tutorials but just can't figure out the correct way in doing it. I got this code from a web site <%@ Page Inherits="System.Mobile.UI.MobilePage"> <%@ Register TagPrefix="Mobile" Namespace="System.Mobile.UI"> <Mobile:Form runat="server"> <Mobile:Label runat="server">Hello, World!</Mobile:Label> </Mobile:Form> Is it true that all I need to do is just paste this code in a notepad and save it with a .aspx extension and I'll be able to run the page? I have visual studio .NET but when i launch the mobile web application project, I can't seems to find the suitable location to paste the above codes. I'm new in this area, any one can guide me please? Thank you in advance.

dynamic device specific script

Postby ashelley » Sat, 02 Oct 2004 02:27:42 GMT

I have this in my aspx page:

--------------
<mobile:DeviceSpecific id=DeviceSpecific1 Runat="server">
	<Choice Filter="isHTML32">
		<contenttemplate>
			<%# ((string)Session["clientScript"]) %>
		</contenttemplate>
	</Choice>
</mobile:DeviceSpecific>
--------------

I have this in my code behind in formload:

--------------
Session["clientScript"] = "<Script for=\"window\" event=\"onload\"
language=\"jscript\">window.Form1.txtJump.focus();</Script>";
--------------

But the client script is never added to the page.  My goal is to be
able to dynamically control which control gets focus when the page is
redrawn.  The following works:

--------------
<mobile:DeviceSpecific id="DeviceSpecific1" Runat="server">
	<Choice Filter="isHTML32">
		<contenttemplate>
			<Script for="window" event="onload"
language="jscript">
				window.Form1.txtJump.focus();
			</Script>
		</contenttemplate>
	</Choice>
</mobile:DeviceSpecific>
--------------

Anyone have any suggestions?  Any insight is appreciated.

-Adam

Re: dynamic device specific script

Postby ashelley » Sat, 02 Oct 2004 06:57:17 GMT




as a hack i created multiple devicespecific controls and toggle them
visible as needed.  This was a less than optimal system but it works.

I would have liked the flexibility to dynamically generate the
scripts.

-Adam

Re: dynamic device specific script

Postby Conor O'Doherty » Tue, 26 Oct 2004 20:58:16 GMT

Thank you
Thank you
Thank you
Thank you
Thank you Adam

I'm only 3 days into my very first web app, and my first requirement is to 
set focus to my testbox.
Could I have possibly asked for a tougher task.
Finally, after trying all the samples & posts to set focus none of which 
worked for me execpt yours.
I have seen other posts which used the same code but put the script in the 
<FooterTemplate> tag which didn't work for me even though others swear by 
it, changing to <Contexttemplate> tag finally set the focus.

So Adam again Thank you :-)

Best Regards
Conor










Similar Threads:

1.Device Specific filter not working.

Hi

I am developing a mobile web VB asp.net application in VS 2005. The forms 
are mobile web forms. I have a mobile web configuration page (web.config).
In one of my forms I have a DeviceSpecific control so that I can choose to 
use an asp:TextBox when PocketIE is detected, otherwise I want to use a 
mobile:TextView control.

Here is a snippet of my asp code:

   <mobile:Panel ID="pnlReport" Runat="server" Font-Name="Arial" 
Font-Size="Small" Paginate="True">
      <mobile:DeviceSpecific id="DeviceSpecificEdit" runat="server">
            <Choice Filter="isPocketIE">
               <ContentTemplate>
                  <asp:TextBox id="txtReport" runat="server" 
TextMode="MultiLine" Rows="5" Wrapping="Wrap"/>
               </ContentTemplate>
            </Choice>            
            <Choice>
               <ContentTemplate>
                  <mobile:TextView ID="txtReport" Runat="server" 
Wrapping="Wrap">
                  </mobile:TextView>                
               </ContentTemplate>
            </Choice>
      </mobile:DeviceSpecific>   
   </mobile:Panel> 

Unfortunately the Device Specific filter never works on the Pocket PC 2003 
SE Emulator that ships with VS2005. The asp.net code always runs the default 
choice. I have discovered that the Internet explorer on Pocket PC seems to 
return a MobileCapabilities browser type of "MSIE".

I have looked everywhere for examples and cannot see anything I have done 
wrong. How do I ensure that PocketPc 2003 will run the "isPocketIE" device 
code and not always choose the default choice?

I should note that my web.config file contains amongst it's device filters:
<filter name="isPocketIE" compare="Browser" argument="Pocket IE" />

Has anyone come across this before and discovered what to do. Any help would 
be much appreciated.
Thank you.
Regards
Justin.

2.Write a app that can suspend/resume device in specific time

Hi there,

I'd like to write a program that can suspend ppc and resume it in 10
seconds. Here is what I'm doing, but it don't work. Please have some
comments if you know how to get device resume again. Thanks

Adam

// start of code
const int POWER_STATE_ON = 0x00010000;
const int POWER_STATE_OFF = 0x00020000;
const int POWER_STATE_SUSPEND = 0x00200000;
const int POWER_FORCE = 4096;

struct SYSTEMTIME
{
            public ushort wYear;
            public ushort wMonth;
            public ushort wDayOfWeek;
            public ushort wDay;
            public ushort wHour;
            public ushort wMinute;
            public ushort wSecond;
            public ushort wMilliseconds;
}

[DllImport("coredll.dll", EntryPoint = "CeRunAppAtTime", SetLastError
= true)]
private static extern bool CeRunAppAtTime(string pwszAppName, ref
SYSTEMTIME lpTime);

[DllImport("coredll.dll",
EntryPoint="SetSystemPowerState",SetLastError = true)]
private static extern int SetSystemPowerState(string psState, int
StateFlags, int Options);

static void Main(string[] args)
{
    DateTime wakeuptime = new DateTime(DateTime.Now.Ticks);
    wakeuptime = wakeuptime.AddSeconds(10.0);

    SYSTEMTIME st = new SYSTEMTIME();
    st.wYear = (ushort)wakeuptime.Year;
    st.wMonth = (ushort)wakeuptime.Month;
    st.wDay = (ushort)wakeuptime.Day;
    st.wDayOfWeek = (ushort)wakeuptime.DayOfWeek;
    st.wHour = (ushort)wakeuptime.Hour;
    st.wMinute = (ushort)wakeuptime.Minute;
    st.wSecond = (ushort)wakeuptime.Second;
    st.wMilliseconds = (ushort)wakeuptime.Millisecond;

    bool flag = CeRunAppAtTime("iexplore", ref st);

    SetSystemPowerState(null, POWER_STATE_SUSPEND, POWER_FORCE);
}
// end of code

3.Waking up device at specific time VB.NET

      Does anyone have any VB.NET code on how to use SetUserNotification to 
wake up a device. I am using VB.NET 2003 and OPENNETCF 1.4. The code I am 
trying to use is:
      Notify = New OPENNETCF.Win32.Notify.UserNotification
      nt = New OPENNETCF.Win32.Notify.UserNotificationTrigger
      nt.Type = NotificationType.Event
      nt.Event = NotificationEvent.Wakeup
      nt.Application = Path & "Invoicing.exe"
      nt.StartTime = dtTime
      intNotificationHandle = 
OPPENNETCF.Win32.Notify.Notify.SetUserNotification(nt, Notify)

      but this gives me the error 'Error setting UserNotification'.
      I am have seen examples in C#, but not being much of a C# programmer, 
I don't really understand what is going on! What I actually want to do is 
wake up the device during the night, perform some overnight processing, then 
set another notification event to do the same thing on the next working day. 
Am I going about it in the right way? Thanks in advance.

      Andy Baker


 


4.Waking up device at a specific time

Hello,

I have a VB.NET 2003 compact framework application. The application will be 
running all the time on a mobile device, and part of the requirements is for 
the device to access the main SQL Server 2000 database during the night to 
upload updated data. The device may possibly be in standby mode at this 
point, so if it is, I need to wake it up. I have found some C# code that 
uses the OpenNETCF RunAppAtTime method to run an application at a specified 
time, that I have incorporated into my app, and it does wake up the device 
at the time that I want it to. However, there are a few potential problems 
that I can see with this approach.
    1) I don't want to run an application, my application will be always 
running, so all I need to do is wake up the device. (This doesn't seem to 
matter).
    2) I can only set the wake up time to a specific date and time. I want 
it to be every night (or every working night) at the same time. This means 
that I need to set the date and time for the next working day after 
uploading, or on start of the application if it is being run for the first 
time.
Would setting the same reminder more than once cause any problems?
    3) I do not know how to cancel a reminder once set. Is there a way to 
see what reminders have been set - at the moment I am keeping a registry 
entry with the date of the last reminder, and if it has already been set, 
don't do it again.
    3) It seems like a very complicated method, with a great potential for 
mistakes. Is there a better way?
    Unfortunately my C# skills are fairly limited, so although I have got 
the code to work, I am not sure exactly what it is doing. I am concerned 
that it may be causing me problems - I can see the device grinding to a halt 
because I have so many threads running setting reminders all over the place. 
Any advice would be appreciated.

Andy Baker 


5.NSIS and device-specific .cab files?

Another installer question!!
1. I need a windows installer that doesn't require the .net framework to be 
installed on the desktop (unlike the MSDN example Setup project that uses the 
CustomInstaller.dll).
2. NSIS works like a charm but I can only specify one cab file at a time 
(although CeAppmgr handles mulitple device-specific .cab files).

Any ideas?

Cheers
Adam
-- 
London, UK

6. determine if a specific USB device is plugged in

7. playing wave files on specific Audio device ?

8. Dynamic cast string value to a specific data type for stored procedure



Return to ASP.NET

 

Who is online

Users browsing this forum: No registered users and 69 guest