MVC IUI reall world example

98 views
Skip to first unread message

Jonathan

unread,
Jun 24, 2011, 8:14:47 AM6/24/11
to iPhoneWebDev
Hi all,

I have been trying to use iui with asp.net MVC razor and constantly
run into problems. I am new to both MVC, Razor and IUI. I have alsways
used .net forms previously.

Does anybody have a good example i could use to learn from. I have
seen rock the iphone with mvc and iui which of course is a great start
but it does not go deep enough for me. ie i want to have a log in
section, a footer tool bar, a search etc which when trying i end up
with all sorts of problems. As an example i have written a log on form
etc which you can navigate to and enter your username and password but
on submit i then if all ok redirect the user to the index page but end
up getting the top toolbar repeated twice.

So please if anyone has a good .net mvc iui example i would really
appreciate it. http://www.iui-js.org/powered-by/index.html?id=moma
from the gallery is very good and has most i am looking for apart from
a login section.

Thanks all and hope i get some help

Jonathan

unread,
Jun 28, 2011, 4:33:04 AM6/28/11
to iPhoneWebDev
Well if no one can help with the above can someone at least provide
some insight into how to update the index/ main toolbar navigation
after a user logs in etc. As when a user logs in they get more options
but this does not work unless you click refresh of the browser which
is not feasible.

Thanks

On Jun 24, 1:14 pm, Jonathan <harwood.jonat...@gmail.com> wrote:
> Hi all,
>
> I have been trying to use iui with asp.net MVC razor and constantly
> run into problems. I am new to both MVC, Razor and IUI. I have alsways
> used .net forms previously.
>
> Does anybody have a good example i could use to learn from. I have
> seen rock the iphone with mvc and iui which of course is a great start
> but it does not go deep enough for me. ie i want to have a log in
> section, a footer tool bar, a search etc which when trying i end up
> with all sorts of problems. As an example i have written a log on form
> etc which you can navigate to and enter your username and password but
> on submit i then if all ok redirect the user to the index page but end
> up getting the top toolbar repeated twice.
>
> So please if anyone has a good .net mvc iui example i would really
> appreciate it.http://www.iui-js.org/powered-by/index.html?id=moma

Remi Grumeau

unread,
Jun 28, 2011, 5:11:40 AM6/28/11
to iphone...@googlegroups.com
Hi Jonathan,

When you login, you put at least a login in session (or a token) +
cookies in options, and of course you need to refresh the whole page
to do so. Otherwise, document headers are not updated and you'll find
nothing in session, even if successfully logged in.

R.

> --
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
>
>

--

Kinds Regards,
Remi Grumeau

Jonathan

unread,
Jun 28, 2011, 5:33:41 AM6/28/11
to iPhoneWebDev
granted you need to but how with iui. I am having the same problem as
this thread now: http://groups.google.com/group/iphonewebdev/browse_thread/thread/f460db68dd02abea

Surely there is a simpler way to handles this with MVC. I have even
tried response.redirect to the main page but then it loads the main
page again insided the current toolbar. Please help.
> > For more options, visit this group athttp://groups.google.com/group/iphonewebdev?hl=en.

Remi Grumeau

unread,
Jun 28, 2011, 6:02:47 AM6/28/11
to iphone...@googlegroups.com
On Tuesday, June 28, 2011, Jonathan <harwood....@gmail.com> wrote:
> granted you need to but how with iui. I am having the same problem as
> this thread now: http://groups.google.com/group/iphonewebdev/browse_thread/thread/f460db68dd02abea

Login is a pretty much serverside process, frontend doesn't have so
much to say here...


> Surely there is a simpler way to handles this with MVC. I have even
> tried response.redirect to the main page but then it loads the main
> page again insided the current toolbar. Please help.

Which is the actual normal process. A login page with a form, that you
submit via JS or plain POST submission... and detect if login/pass is
ok server side. If not, just render the form again with a clear prompt
message ("wrong pass", "no account with this ident", ...) and if
login/pass is ok, redirect to the "index" of your app. On load, this
"index" should normally test session if ident / token is ok and render
your app (and if not, redirect to login form).

If you deal with session or cookies (or anything in headers), just
forget about ajax form submission ...

R.

Jonathan

unread,
Jun 28, 2011, 6:34:14 AM6/28/11
to iPhoneWebDev
Thanks for your reply its much appreciated. I understand the process
of servier client side processes, and have a webapp that uses them
fine for getting dynamic data displaying it etc.

But after login i want to show them the toolbar with their extra items
etc but i cant even do a full post back without the iui js jumping in
and loading it in the main toolbar as 99% of the time you want to
happen. I am sure there must be away to refresh the toolbar as the
thread i attached above shows but why is something easy not integrated
into the iui code ie a link to the main page with refresh content etc
or simiiar that overides all else.

Thanks again. Sorry if i did not explain my problem well enough


On Jun 28, 11:02 am, Remi Grumeau <remi.grum...@gmail.com> wrote:
> On Tuesday, June 28, 2011, Jonathan <harwood.jonat...@gmail.com> wrote:
> > granted you need to but how with iui. I am having the same problem as
> > this thread now:http://groups.google.com/group/iphonewebdev/browse_thread/thread/f460...

Sean Gilligan

unread,
Jun 28, 2011, 6:49:04 AM6/28/11
to iphone...@googlegroups.com
Have you

On 6/24/11 5:14 AM, Jonathan wrote:
> So please if anyone has a good .net mvc iui example i would really
> appreciate it. http://www.iui-js.org/powered-by/index.html?id=moma
> from the gallery is very good and has most i am looking for apart from
> a login section.
>
> Thanks all and hope i get some help

Have you looked at the links on this page:
http://code.google.com/p/iui/wiki/iUIWithASPNet


-- Sean


Jonathan

unread,
Jun 29, 2011, 4:04:32 AM6/29/11
to iPhoneWebDev
Yes thanks, i posted a question there a few weeks ago and was advised
to use this forum but i may post thet above problem there as well to
see what comes from it. thanks again for you help.

On Jun 28, 11:49 am, Sean Gilligan <msgilli...@gmail.com> wrote:
> Have you
> On 6/24/11 5:14 AM, Jonathan wrote:
>
> > So please if anyone has a good .net mvc iui example i would really
> > appreciate it.http://www.iui-js.org/powered-by/index.html?id=moma

Sean Gilligan

unread,
Jun 30, 2011, 7:23:42 PM6/30/11
to iphone...@googlegroups.com
You should get better help in this group then in the comments on the
wiki page. I just wanted to make sure you had looked at some of the
linked blog articles, etc.

-- Sean

Jonathan

unread,
Jul 5, 2011, 1:17:32 PM7/5/11
to iPhoneWebDev
Thanks Sean and Remi for you help.

I still have not managed to get this working, granted I have been busy
on other stuff but still I am disappointed that no one else has
offered any help to the posts. Next step stop using IUI, I guess and
go with something else.

Remi Grumeau 

unread,
Jul 5, 2011, 1:54:50 PM7/5/11
to iphone...@googlegroups.com
Well, honnestly i don't really think iUI is the one to blame here... good chances you'll have the same problem since you keep on slidings.
Also, if you want some professionnal dedicated help to spend hours solving this really specific problem you have, i'd be glad to work with you & find a solution for that... as a contractor (and i guess some others would too :))

To me, a mailing list main goals are to discuss issues / bugs or project related choices we want to ask community pov. It's also kind of a getting started help for newbies (where a good doc + faq could do a good job too).
Community, help & sharing in mind around the project.
Not being a 24 / 7 free tech support service (at least not in my mind)


R.

Jonathan

unread,
Jul 6, 2011, 9:13:24 AM7/6/11
to iPhoneWebDev
So in your eyes a forum such as this is not a place for developers to
find information relating to IUI or alike products on techniques or
problem solving, so once issues raised and solved can provide others
with similar needs to find held / direction etc. Then I'm sorry but
that is the whole ethos of forums!


On Jul 5, 6:54 pm, Remi Grumeau  <remi.grum...@gmail.com> wrote:
> Well, honnestly i don't really think iUI is the one to blame here... good chances you'll have the same problem since you keep on slidings.
> Also, if you want some professionnal dedicated help to spend hours solving this really specific problem you have, i'd be glad to work with you & find a solution for that... as a contractor (and i guess some others would too :))
>
> To me, a mailing list main goals are to discuss issues / bugs or project related choices we want to ask community pov. It's also kind of a getting started help for newbies (where a good doc + faq could do a good job too).
> Community, help & sharing in mind around the project.
> Not being a 24 / 7 free tech support service (at least not in my mind)
>
> R.
>

Remi Grumeau

unread,
Jul 6, 2011, 9:44:22 AM7/6/11
to iphone...@googlegroups.com
Agree, It is. And you'll find a lot of tips, Q&A here. For mobile web.
But not when it gets project specific due to a technology that is not
an mobile web (.Net MVC is nothing mobile but clearly server side).
That's why Sean adviced you to post it on kind of a more adapted list,
with people having some similar needs, issues, ... and directions to
go with .Net MVC programming.
That's why we also moderate all posts about native mobile development.


>> Next step stop using IUI, I guess and go with something else.

For your project, we told you twice you can't login via an Ajax call
since a session (server side) needs user browser headers to refresh.
iUI has nothing to do with that (best example:
http://m.pocket-locator.com, powered by iUI, with a login/pass
pre-home.).
Of course, if you switch to iwebkit or webapp.net you'll won't have
issues with that since they don't provide any transition or ajax form
processing. But you'll have similar "issue" with JQTouch, JQuery
Mobile or Sencha with .Net or PHP server-side.

R.

--

Kinds Regards,
Remi Grumeau

Sean Gilligan

unread,
Jul 11, 2011, 7:24:18 PM7/11/11
to iphone...@googlegroups.com, Jonathan
On 7/6/11 6:13 AM, Jonathan wrote:
> So in your eyes a forum such as this is not a place for developers to
> find information relating to IUI or alike products on techniques or
> problem solving, so once issues raised and solved can provide others
> with similar needs to find held / direction etc. Then I'm sorry but
> that is the whole ethos of forums!

I think this place is (or tries to be) what you describe. But there are
two limitations you will find: (1) people are volunteering their time,
so may not be able to dive into your particular issue as deeply as you
like and (2) people are not experts on server-side technology such as
ASP.net MVC.

When troubleshooting potential iUI problems we always ask people to try
to reproduce the problem in as simple an example as possible using
static HTML files.

Have you tried asking for help on any ASP.net MVC forums?

-- Sean

Sean Gilligan

unread,
Jul 11, 2011, 8:35:21 PM7/11/11
to iphone...@googlegroups.com, Remi Grumeau
On 7/6/11 6:44 AM, Remi Grumeau wrote:
> For your project, we told you twice you can't login via an Ajax call
> since a session (server side) needs user browser headers to refresh.
> iUI has nothing to do with that (best example:
> http://m.pocket-locator.com, powered by iUI, with a login/pass
> pre-home.).

I have built an iUI app that used Ajax for login. So, It is possible.

In the case of this particular app, all requests to the server were done
with Ajax, so I was able to store the login information using JavaScript
and made sure to add it to every Ajax request.

It really depends upon the structure of your application and the way
your server handles authentication.

-- Sean


Sean Gilligan

unread,
Jul 11, 2011, 8:53:56 PM7/11/11
to iphone...@googlegroups.com, Jonathan
On 6/28/11 3:34 AM, Jonathan wrote:
> But after login i want to show them the toolbar with their extra items
> etc but i cant even do a full post back without the iui js jumping in
> and loading it in the main toolbar as 99% of the time you want to
> happen. I am sure there must be away to refresh the toolbar as the
> thread i attached above shows but why is something easy not integrated
> into the iui code ie a link to the main page with refresh content etc
> or simiiar that overides all else.
It is not entirely clear to me what you are saying here.

A suggestion. Try starting an entirely new post (with a subject line
like "how to handle login with iUI or similar framework"). Try doing
the following:

1) State the big picture problem you are trying to solve. (There may be
more than one solution to your problem) There is definitely more than
one way to handle login with iUI/Ajax. You should include any
requirements your server has for login, but please state them in terms
of HTTP rather than ASP.net -- that will allow many more people to
understand the problem and offer help.

2) Provide detail about one or more attempted solutions you have tried.
Provide a link to a sample installation of the code if possible, so
people can look at it in their browser (and possibly use their JS
debuggers,e tc)

3) Try as much as possible to separate the client side issues from the
server-side issues. (Nobody here seems to know much about ASP.net)

-- Sean

Jonathan

unread,
Jul 12, 2011, 12:46:59 PM7/12/11
to iPhoneWebDev
Sean, Thankyou very much for your help, it is much appreciated. I will
look into 2 things the first login with ajax and js then passing it to
every request or even if i could after login use javascript to check a
user is authenticated ( can javascript acess cookies or server
sessions), if you have a snap shot that would be fantastic if not i
will search google for something. Is your web app using php, ruby or
just javascript, just curious really.

On the creating a new post etc i will try the above and then if i have
no luck i will try to right a better post as you sugest and create a
demo site which will clearly show the problems i am having.

Thanks again
Reply all
Reply to author
Forward
0 new messages