I have a .NET project that needs a login form. The action of this form should take the user to the external site (Symplicity) and log them in. I've looked in to some methods (HttpWebRequest and creating a form with javascript), but being fairly new to .net, not sure they will work out for me.
What would be the best way for me to achieve this?
A form cannot be nested within an ASP.NET WebForm. You can use IFrame and within the IFrame you can host your other form.
Related
Using asp.net How to pass values from child page to parent page.without affecting past records
I have one Parent Page.So i have to search some user information based on name,mobile no,city and id.
if any one of basis selected record should pass to the parent page without changes of previous entered details.
I think what you need is AJAX.
If I understand, you want to update a part of the page (search results) without refreshing the rest of the page (search form)? This is easily achieved with JavaScript (being one possibility, another would be something like SignalR).
Here is an introduction to AJAX with ASP.NET MVC: Walkthrough: Adding ASP.NET AJAX Scripting to an MVC Project
With that said, you don't especially need ASP.NET MVC to do what you want. You could also use jQuery, or plain old vanilla JavaScript.
If what you are building is a "web application", you may want to take a look at SPA frameworks like AngularJS, DurandalJS, etc.
I have following problem.
I have homepage with form , that have it's own logic , now I need to add a widget on this
page , what the widget should do , it's to post some Data Input from user to another aspx page.
Unfortunately I've came to ASP.NET from MVC (and have no idea how to do it in asp.net), and there I'd implement it by adding another form to page , that will post to Controller I need.
In ASP.NET I can't put another form with runat server attribute , can anyone advise the best way of implementing this task ?
Quite simple, and thanks to the magic of modelbinding not much that you have to do.
QueryString values along with id parameter in ASP.NET MVC
I (and most other's i believe, rather prefer route data (people/get/1 vs people/get?id=1)
I am trying to figure out how to use/create a custom control in ASP.NET MVC 2.
I created a custom control earlier and compiled it (ccontrol.dll), the control renders a div, textbox and a button + some javascript in order to post a comment on the website. It could be a static aspx page that i wanted to allow my visitors to add a comment to. I would then drag my control from the toolbar to the aspx page and run it, it would then render all the code needed on the webpage including fetching the data from a datasource and displaying that inside the div. The user could also just type in a comment and press the button to save it to the datasource.
Is this possible to convert to MVC 2? Any good tutorial that covers custom controls and MVC 2? (Ideally would be if the control could be made into a .dll file that i then could reuse on future webpages)
How do i write a custom control the mvc way? Any good tutorials on the topic?
You cannot design Custom Controls according the normal asp.net style because in Mvc there is no ViewState and there are no server side control events. Data are returned back to the server through a Model Binding process. The fact that rendering and filling data in are handled in separated pieces of code make difficult to implement complex server controls in Mvc.
However, I developed a theory, and also a toolset to make quite easily custom controls ina Mvc too in the full spirit of the Mvc paradigm i.e keeping separation of concerns between Views and Controllers. See My Codeplex project. There, you will find pointers to documentation and tutorials on my blog. If you need assistance feel free to contact me.
No it is not possible to use custom controls in ASP.NET MVC. you need to re-write in MVC way
I have read a few threads and look round the web but still haven't found a solution.
I want to validate a form using jquery but the way in which the asp.net page is built is different from examples round the web.
The whole page is wrapped in a from tag and not the actual individual form.
The only way I have found so far is to use this plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ but to attached a click event rather than the prefer onsubmit. Is there way way to use onsubmit with .net controls?
Many thanks for any assistance.
C
I realize that ASP.NET is only designed to support a single form. What I am confused about is what is the appropriate method for coding multiple "forms" on a .NET page (I have a login form at the top of the page, via the Site.Master and other forms will appear on any given page). Am I supposed to respond differently? It doesn't really make a whole lot of sense. I would appreciate it if someone could clarify. Thanks.
P.S. I am currently developing on .NET 2.0 although I plan to move to .NET 3.5 soon.
Nearly all ASP.NET Web Forms post back to the same page. Unless you are working on some strange outlier (which your question doesn't indicate), you just use one form tag around the entire document, and use event hookups to your controls to handle the various instances.
For example, you can have three buttons that act as Submit buttons, one for each "form" but all inside that same form tag, and each one will call its respective event. This behavior is standard and handled by ASP.NET for you; all you have to do is write the event handlers and wire them up.
I'm not sure what you mean by a logon form. Are you doing some special ajax stuff?
You should be dividing any logical "form" as you call it into its own usercontrol.
http://www.asp101.com/lessons/usercontrols.asp
When dealing with aspx pages, think of the form on the page the same way you think of the body tag.
In that case, I would hand-code the login form at the top to submit to a separate login.aspx page. Leave the rest of the page to the other form's own purpose.
by default you can't, it's how the whole webforms technology works (MVC would probobly fix this in the newest versions).
So really it depends on what you want the "two forms" to do. For example, there's no issue with having login & search on one page, as each button has its own click event and go from there. If you wanted a second aspx page to process one of them, you could collect values and pass them through a response.redirect or some other hacky solution.