mobile command control with ImageURL property set

K

kapilp

hello,

i have 2 issues when using the mobile command object with its ImageURL
property set.

- i am using vs.net 2005.
- i am testing on a Openwave version 7 enulator

1- When the ImageURL property of the control is set the image never shows up
on the openwave enulator or any cell phone i try. I have tried several. Only
the text shows. I know that the image is valid because if i use the same
image with the mobile image control or the mobile link control, the image
shows up perfectly on phones and the openwave browser. The image only renders
correctly on an PC based internet browser.

2- When i use the command object with the ImageURL property set its Click
event never hits. as soon as i remove the imageURL then the event hits. If i
just hit F5 this behavior happens, but if I copy the project to run under my
local IIS instance then this problem does not occur.

I looked at the wml that renders in the emulator and its this:

<p:do type="accept" label="Login">
<p:go
href="/PhoneFling/(X(1)S(pp4c3n3t0jt4ke20g0msfgyf))/Default.aspx?ReturnUrl=%2fPhoneFling%2fHome.aspx&AspxAutoDetectCookieSupport=1" method="post">
<p:postfield name="__VIEWSTATE"
value="/wEXAQUDX19QDwUIZnJtTG9naW5kuxODygIHWlrY59nhTqGysdluZR0="/><p:postfield
name="__EVENTTARGET" value="cmdLogin"/><p:postfield name="txtScreenName"
value="$$(txtScreenName:noesc)">
</p:postfield>
<p:postfield name="txtPassword" value="$$(mcsvkfega0:noesc)">
</p:postfield>
</p:go>
</p:do>

As you can see there is no mention of an image anyware. From my
understanding there should be an <img> tag by the <do> tag, I think.

Could it be that the command control is not rendering the proper wml for WAP
browsers?

Bascically I need the command to show up as an image on the wml based
browsers and its click event to fire.

Help????

Thank You,
Kapil Pershad
 
K

kapilp

I found this article.

http://msdn2.microsoft.com/en-us/library/wa642f6e.aspx

I think that I can use the Wml adapters to render the image text under the
<do> tags when it renders in WML. When I try to download the cource files and
install the mobile internet toolkit it tells me that its detected an
incompatable version of .net. I am developing in 2.0 using Visual Studio
2005.

Seems like tesre is no solution to this bug? Has anyone at MS been able to
verify this?
 
K

kapilp

I am posting a new thread per the request of my online concierge Oliver. He
says this will help in getting my question answered by the MSDN support.


Thanks,
Kapil
 
S

Steven Cheng[MSFT]

Hi Kapil,

Thank you for posting and sorry for the delay.

Regarding on the two issues of the ASP.NET Mobile "Command" control you
mentioned, based on my research, here are some of my finding:

1. As for the "click" event, there does exist an known issue that the
command control's Click event will not fire correctly when the ImageUrl is
set. And this problem is planed to be fixed in the next version. Currently
there is a workaround:

because the problem is actually caused by something not stored correctly
with the ViewState(if the viewstate is empty ...), we can manually store
some data into viewState in the first request of the page so as to make it
non-empty. e.g:

# suppose there is a Label control (lblMessage) on the page
===========
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblMessage.Text = "Init Value";
}

}
===============

Then, the button's click event can fire correctlly (with ImageUrl set).

2. As for the Image's displaying in WML client, so far I haven't found any
document on this. However, it seems that the image info is not output for
WML client. I'll do some further research on this and will update you if I
got any updates.

Thanks for your understanding.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
K

kapilp

Hi Steven,

I implemented the fix. The fix works when I copy my project into IIS!
Thanks. One thing is that the fix only seems to work in IIS. If I run the
project using ASP.net development server(F5) then it does not work. Anyway no
big deal.

As far as the image not rendering i found the following article.
http://msdn2.microsoft.com/en-us/library/t32t3y06.aspx. It says:

"When a rendered form includes UI to submit the form results back to the
server, some WML-based devices require that the UI for the specified device
must be in the form of a <do> object at the start of the form. The Openwave
Up.Browser browsers are an example of such a device."

So basically the command object is being rendered as a <do> tag. If this is
the case I should be able to put an <img> tag with the <do> tag but I cant do
custom rendering in .net mobile.

Then I found this article:
http://msdn2.microsoft.com/en-us/library/wa642f6e.aspx which would help me
to do the custom rendering except for the fact that I cant install the
http://go.microsoft.com/fwlink/?LinkId=6350 file.

This issue is very important to this project. I hope we can find some
solution.

Thanks
 
K

kapilp

Also, is there anyway I might be able to postback when I click on the image
control because the image controls and link controls do render correctly.

I tried to manually run the doPostBack() function and make asp.net think I
was click on the command button when I was actually clicking on the image
link. This worked on IE but fails in the WAP browser probibly because there
is no support for javascript in the WAP browser.

Any ideas on this?
 
S

Steven Cheng[MSFT]

Thanks for your followup kapilp,

As for the mobile toolkit's issue, it is caused by the toolkit is shipped
with framework 1.0 oringally, after that it becomes part of the framework
base class library. So we need to install .net framework 1.0 so as to
install that toolkit. I've tried it and it works(with the adapter's source
code installed).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
K

kapilp

The code is different from version 1.0 to 2.0. i am using asp.net 2.0 in
visual studio 2005. if i implement the old code then i will be losing out on
features and probibly create more bugs.

i dont want to start developing in 1.0 now.

what is the solution for this issue in asp.net 2.0?
 
S

Steven Cheng[MSFT]

Hi kapilp,

The code is the referenced code, you can just copy the certain adapter's
code out and compile it in your own 2.0 class library project. That doesn't
mean we have to use 1.0 framework. After you create your own custom
adapater for a certain built-in control, you can update the adapter
mappings which is defined in web.config. And the default setting is in the
global web.config(under .net framework system folder ):

#Adapter Mappings
http://msdn.microsoft.com/library/en-us/mwsdk/html/mwconadaptermappings.asp?
frame=true

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top