Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 23, 2009 03:04 AM by paul.vencill
Apr 21, 2009 06:14 PM|LINK
Can any one help me??
I am new to ASP and ASP.net (MVC).
I have written a Model, Controller and an ASP Page(view)
My page is very simple that it connects to an MS -Access database and fetch the data and show it on the page when i click the Load push button.
Here is my code//
<%= Html.TextBox("PID")%> // it works.
MVC C# Textbox MS-Access
Apr 21, 2009 07:50 PM|LINK
I'm pretty sure that the problem is because you're trying to mix ASP.NET and ASP.NET MVC Code. If you go with ASP.NET MVC, just know that the <asp:*> controls won't work.You also may want to run through some of the tutorials at http://www.asp.net/learn/mvc/
It is possible to create hybrid applications that use both technologies, but I wouldn't recommend it for someone who's just starting out.
Apr 21, 2009 08:15 PM|LINK
I have started learning ASP in less than a month and now I have already designed 80 web pages in my project with <ASP:Textbox> etc. and dont want to use <% Html > tags, definetly i want to use these <ASP:textbox> in my code. Iam going to use rich formating
and validations using these <ASP: > . Please let me know how to get the value from the controller on to my push button event and display in my web page textbox with out modifying the <asp:*>. ??
Thanks for the Help
C# MVC Textbox contol - Help
Apr 21, 2009 08:27 PM|LINK
VJ, Sorry to hear about so many pages, perhaps you're better off converting the whole hting to a regular web forms app?
While you *should* be able to get ahold of the Model property in the ViewPage and set a value from that equal to the text of a textbox, you're probably going to cause other problems elsewhere in yoru app, since textboxes and the like are built to use viewstate,
while the MVC framework does not provide viewstate, and things like postbacks and click events are alien to the MVC framework's infrastructure.
Apr 21, 2009 08:30 PM|LINK
I have already designed 80 web pages in my project with <ASP:Textbox> etc. and dont want to use <% Html > tags, definetly i want to use these <ASP:textbox> in my code. Iam going to use rich formating and validations using these <ASP: > .
Then ASP.NET MVC probably isn't for you. Why not stick with the existing WebForms-based code if it seems to be working?
Apr 21, 2009 08:36 PM|LINK
Thanks.. Can you show a sample piece of code for this... For to have better understanding..
MVC C# MS-Access <asp:Textbox
Apr 21, 2009 08:39 PM|LINK
My project manager is specific about coding in MVC and ASP.net (C#). Initially i didnt understand the model, but now im getting bit hold on this. If you can help me in getting this solved it will be of gr8 help.
Apr 21, 2009 08:49 PM|LINK
My project manager is specific about coding in MVC and ASP.net (C#).
If your project manager is asking you to use both ASP.NET MVC and the standard ASP.NET built-in controls, then he probably doesn't have a good grasp of what ASP.NET MVC is. These two things are fundamentally incompatible.
If you really, really need to use MVC and some type of server-side controls, you can find some experimental ones in the MVC Futures assembly on CodePlex. But they're nowhere near as powerful as it sounds like you need, e.g. they don't have built-in features
like validation. See
http://weblogs.asp.net/leftslipper/archive/2009/03/03/asp-net-mvc-release-candidate-2-i-declare-myself-to-be-declarative.aspx for more information.
Apr 21, 2009 08:50 PM|LINK
Honestly, there's not an easy solution to your problem. 80 pages or no, your best bet is to learn the way the MVC framework is done right (if he's insisting on it) and then do it that way. Anything else will be a lot more work and probably not meet your
project manager's goals.
Apr 21, 2009 09:02 PM|LINK
Ok,, How to call the function() that is there in the controller from my button click event../