First of all my apologies for asking a question which looks like a request for a code, however it was not my original intention. May be I have not choose my words carefully. All I wanted was a way to pass information between views, controller and models without Entity FrameWork. Please note my first language is not English that may cause the confusion.
I have been doing some research so I will explain what I learn, for those who may have same issues and would come to this page.
There are following ways to get values from view back to controller after submitting the form. lets assume I have a text box in my form(View) named "txtBox" and I want to pass whatever user types in, back to controller.
1. FormCollection object
FormCollection is builtin object, which will give you access to all controls of the form.
public ActionResult Index (FormCollection col) {
string str = col["txtBox"];
}
2. Request object
public ActionResult Index () {
string str = Request["txtBox"];
}
3. I can't name it but it is a simple parameter passing. please note that name of parameter should be same as name of control(in this case txtBox). you can have multiple parameters depending upon number of controls you want to access. I agree not a very pretty way, but it works.
public ActionResult Index (string txtBox) {
string str = txtBox;
}
and ofcourse we have the option to tie your view to Model and then pass that model object back to controller.