|
gives me javascript error on tracing as below
jscript runtime error :document.getelementId(...) is null or not an object
???????????? whats that
thx
By:
Hemant Thaker
|
|
|
|
|
Hemant Thaker wrote:
jscript runtime error :document.getelementId(...) is null or not an object
???????????? whats that
I dont know, what you are doing with getelementId ???
Try this :
.cs file code ::
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "Check_Wrong_AnsString", "SetServerValue()", true);
Response.Write(HiddenField1.Value);
}
Javascript ::
<script language="javascript">
var HClientID="<%=HiddenField1.ClientID%>";
function SetServerValue(args)
{
var hidID=document.getElementById(HClientID).value = "false";
}
</script>
ASPX :
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:HiddenField ID="HiddenField1" runat="server" />
Try and run this. This working fine !!
Hope this will help you. Let me know if u have any more issue !!
|
|
|
|
|
wow.. nice answer my budd.
|
|
|
|
|
Hi,
I have a form where there is a combobox, and next to it there is a link "Other" that opens a popup and lets the user to create more options (that dont appear in the combo)
How can I notify the parent form (the one with the combo) that the popup form added succesfuly the new option?
With winforms is really easy using events.. but in web its confusing
Help please!
Thx
|
|
|
|
|
Do you want to pass value from child window to parent window? This article may help you. Link[^]
|
|
|
|
|
Hi All
I need to have a 4 page registration form.
Each page asks for a different set of details and the details need to be added in different table
for each page.
The last page of the process is a confirmation page that shows all the details entered in the first 3 pages.
Incase, if user wants to change anything he can go to the previous page and edit through the site map.
So what is the best way to acheive this kind of functionality?
Thanks in advance!!!
IT_Help
|
|
|
|
|
Practically speaking, If I would be in your place I would have create 4 different place which I would navigate one by one and store data into database.
I would also create a breadcrumb in the header which will point to every page I traversed and get the data properly from database upon visit.
|
|
|
|
|
Thanks for your reply.
I was thinkking of doing the same way and almost completed the coding to do this, but the problem is the entry in first table drives the entries in next tables, so if i have to edit anyting on first page then the next dont stand a meaning as i have to insert again .
i will explain you through an exapmle
My first insert in first table generates an identity feild which i was putting in session and then on second page i was making an insert based on the identity feild generated in first table
From DB perspective the tables had a foreign key contraint which didnt allow me to insert in second table till there is an entry in first table.
I read somewhere about storing the whole data in a session object and doing the insert after the user confirms on the last page.
What do you say about this approach?
IT_Help
|
|
|
|
|
IT_Help wrote: I read somewhere about storing the whole data in a session object and doing the insert after the user confirms on the last page.
Well, I strongly oppose this. I think you should use your page a better way rather than relying on so much in session.
Regarding your problem, I think it is very common problem and we often face the same thing. I would suggest to send this within a hidden field. If you are using Request.Redirect to go to another page, you might use Querystring as well. Just inside the page store the value(id) that comes through querystring to your hidden field, and when this page is going to save, you will get the data from hidden field.
This is a good approach. Why should you store data on session if the information is not so much sensitive. You should only store data like user authentication level to session so that you could validate the session on every request. Nothing more should be stored in session.
I hope you understand. If you still having problem, let me know.
|
|
|
|
|
Add an if statement in pageload event on every page that checks database if the entry for that user exist, if it exist then all field sould be preloaded with the data in the database and when the user hit submit, do a nother check and if the entry exist then the system should update database, if not then save the new entry.
|
|
|
|
|
Hey ! Thanks for your reply, but i am not maintaining any users so cant check the user id.
I will surely keep this in mind if in future i need to do anything like this.
Anyways i have replied above and explained the problem more elaborately.
Do read it and give your inputs as well
Thanks!!
IT_Help
|
|
|
|
|
Do you have a primary key in your table, if so how do you generate you unique key
|
|
|
|
|
My first table has 'ApplicationID' as primary key which also set as identity.
All the other tables they have 'ApplicationID' as a foreign key.
In addition to this , the primary key for the other tables is
ID(of that table)+ApplicationID(of first table)
IT_Help
|
|
|
|
|
You can still do what i told you, instead of using identity, generate a unique key in your code on first page and set a session object equals to the unique key. Every time the user go back to previous page,System do a preload by using session object.
|
|
|
|
|
create the entries in all tables on first page when page load to avoid foreign key contraint and update them when user submit on every page.
|
|
|
|
|
Hello,
I have a web application built in Ajax. When the user opens the app we need to establish a connection (from client side) and keep it open for as long as they are active to a server on a different domain. (The domain spoof and web service work around not really an option for us).
The user as they interact with the ajax window will send data to the third party server with responses. Sometimes the third party server will send the end user updates that will need to be handled and the Ajax window updated with the new info.
I have built this in .Net2 (mandatory version) and c#. I have all the interactions working with a test hook (windows form) but now I need to move it to the web.
So do I do the painful, outdated ActiveX thing or is there a better technology to solve this. BTW The users are forced to use IE by other site requirements outside my control. I KNOW this has been done many times before so any information how others accomplish this would be greatly appreciated. JB
|
|
|
|
|
If you want to keep your application connected, why dont you use silverlight??
I have made one chat application in silverlight which keeps both client and server socket connection open using WPF and it is working fine.
Normally using http, it wont be possible, silverlight or Adobe AIR would be a better option for you.
|
|
|
|
|
Silverlight is a consideration but then wouldn't I have to redo my entire app in Silverlight? This question shows my ignorance of Silverlight. I mean all my Ajax code, grids, etc would have to be recoded in Silverlight. Now if that's what it takes then that's what it takes but was hoping to avoid that...???
|
|
|
|
|
Yes... This is a point. But what is the problem of creating connections to your server using AJAX in a timer.. means using SetTimeOut. Does you really require to have Socket connection established and running for the entire session ?
Take for example, Gmail establishes more than one connection to their server using normal XMLHttp object and updates the Chat and mail section. Why dont you use this to update your website.
Is socket connection is mandatory?
|
|
|
|
|
Yes. That is the rub. 3rd party forces socket connection & third party may send data realtime and we need to handle realtime. So to clarify to use Silverlight I would have to recode in silverlight or can Silverlight wrap the way Ajax modal dialog does. In other words instead of popping an Ajax window that loads a page can I pop Silverlight that loads the same page. I.E. recoding would be very minimal.
|
|
|
|
|
i have to give link for a image
if any one click the images it will go to another page what i want
|
|
|
|
|
Place the image tag inside an "a" tag.
<a href="your url"><img src="image url" /></a>
|
|
|
|
|
this code shows any blue border around the image
|
|
|
|
|
set the image border to zero.
<img src="image url" style="border ;" />
|
|
|
|
|