|
Depends, in what directon ? You can write the value in your codebehind, so that it's passed to javascript as a variable definition. To go in the opposite direction, you should put a hidden field on your page, set it's value in javascript, and grab it out of your code behind. But, again, no postback occurs if you call window.location.reload. Two people have explained this to you already. There is no postback, and so any javascript values are lost.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you sir, but I know they have explained me but its not working. Here is the javascript function:
function ActiveTabChanged(sender, e)
{
var mytool_array=sender.get_activeTab().get_id().split("_");
document.getElementById("<%=htxtQueryStringValues.ClientID%>").value = "fromtab=true&tab=" +mytool_array[4] +"&sheet=" +sender.get_activeTab().get_headerText() ;
alert(document.getElementById("<%=htxtQueryStringValues.ClientID%>").value);
window.location.reload();
}
And on Page Load I get the value of hidden textbox values as blank....
Please tell me Is there anything I am doing wrong in above code???
|
|
|
|
|
I'm not sure how many attempts it will take before you actually understand what you've been told over and over.
ASP.NET 2.0 wrote: window.location.reload();
This does NOT do a postback. Therefore all your javascript values are lost. The page lifecycle restarts as if the last request occurs. A postback does not occur. A postback does not occur. A postback does NOT occur.
So, as you've been told, you need to initiate a postback, which you can do by calling click on a button which posts back, or by working out the javascrpt method to call directly.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
May i know what is the difference between State server and SQL server modes
and also about Inproc? In which scenarios they are used?
Tell me in which scenarios they are used?
Thanks in advance,
pavan...
|
|
|
|
|
pavanteja wrote: Inproc
Stores in the memory. If no session mode is specified, this will be default
pavanteja wrote: State server
Stores session state in another process called ASP.NET state service. Ensure the session availability after restarting the webapplication.
pavanteja wrote: SQL server modes
Stores in SQL Server database.
Check this[^] article to get an idea about how to choose the best method
|
|
|
|
|
that is ok with me........But may i know what is difference between state server and SQL server.........In wat cases they use......I mean the need?
pavan...
|
|
|
|
|
Please go through the link I have given. It explains that in last section
|
|
|
|
|
sorry.....I dont find any link in ur reply...........
pavan...
|
|
|
|
|
|
Hi,
I am Using a List<city> to store the data retrived from database...
My code goes as this
Service Layer Method:
public List<city> GetCities()
{
DataSet ds= cdb.GetCities();
List<city> city = new List<city>();
foreach (DataRow row in ds.Tables[0].Rows)
{
city.Add(new City(row["city_id"].ToString(), row["city_name"].ToString(), row["state_id"].ToString(), row["city_classification_id"].ToString()));
}
return city;
}
In Application Layer: I am Caliing the method as below
GridView1.DataSource = cs.GetCities();
GridView1.DataBind();
It works fine but ....
The Columns are not coming in the same order as in Database i.e... CityID, CityName, StateID, cityClassificationID.
The column order comes in as cityClassificationID,CityId, CityName, StateID.
But I want them in the same Order i.e CityID, CityName, StateID, CityClassificationID...
How to accomplish this....
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
Turn off auto columns and define them yourself in the order you want.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Strange, Why don't you return the DataTable object from dataset ? Any way you are iterating through all rows, or is there any other reason that you are specific with List ?
|
|
|
|
|
There is a school of thought that suggests the data layer should return collections of objects instead of database related classes.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: There is a school of thought that suggests the data layer should return collections of objects instead of database related classes.
Great information. I was not knowing.
What will be the impact when it returns Database classes ? upto my knowledge, DataTable is also a collection class which contain a collection of DataRows. So what is making difference ?
|
|
|
|
|
He's returning a collection of entity objects. It's at least partially a religious discussion. I've seen all sorts of other OO principles thrown out in order to pursue this one goal. It's not clear cut, and you need to make a call based on the needs of your project.
It is very sexy to call the data layer and get back a list of custom business objects, tho.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi friends
In my asp.net form, I want receive an image from network and show it. The image has jpeg format and is sent in Byte[] format. When I receive it, how can I display the image? pleas write the code.
thanks
|
|
|
|
|
your server needs to recieve the image, and either save it to the hard drive, or your page will need to show the image and nothing else, then you can do a binary write
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks so much , but can you tell me how binary write works for display image?
|
|
|
|
|
82130012 wrote: but can you tell me how binary write works for display image?
Binary write to the Response. Set the Response content type to image.
|
|
|
|
|
Hai all,
I have a problem that in my application i have two forms which are related each other.
When i save the first form and move to the next form,my problem is if i want to see the values in the first form,if click on back button all the textbox values become blank.Which prperty i need to set for saving the value.
Bcz i just want refer before saving the second form.plz tel lme the solution.
Plz give me a solution
Regards
kissy
|
|
|
|
|
You can pass the values from the first form to the second with cross page postback or on the URL, then have a button within the page which goes back and repopulates the old page.
The other way to do it, is to make both form controls that appear on the one form, then you will have viewstate between what appear to be pages.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: The other way to do it, is to make both form controls that appear on the one form, then you will have viewstate between what appear to be pages.
You mean in single page and changing the visibility ? But browser will keep the posted data on cache and repost on hitting refresh. Are you familiar with Java beans ? I think that is something related to passing values between pages, but not sure
|
|
|
|
|
Well, I have a vague idea about beans, what I can say for sure, is they are not going to help the OP, who is using ASP.NET.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
if u want to see the information u must session,viewstate to store the information......
i think it is not possible by setting a property .........
Have great programming....
|
|
|
|
|
But if the form has many controls and if i set autopostback is true,it doesnt look good for each control page will be postback.
But by using viewstate or session variables ,it is not good.
i dont have any idea of javabeans.
How to solve this problem.
Bcz forms are big in size(so many controls).
give me some other idea.
kissy
|
|
|
|