|
If you're in an update panel then you're already calling javascript, the page has already loaded, and any script you insert like this, isn't going to do anything. you need to send something back to the client in the ajax response, and write script that recieves this notification and responds to it. How easy that is to do within the MS framework, I am not sure.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Dear Graus,
I am newbie to AJAX.
So I couldn't get you.
Can you give me a link or sample to do it.
Thank you.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I don't know how to tell you this, but what you're telling me is that you know nothing about AJAX and you're riding the back of a Microsoft library that I frankly would not use. I have done a fair amount of AJAX work, I evaluated the ASP.NET library and decided it was not for real programmers. Your only solution that I can see, is to learn what AJAX actually is, and either work out how to write your own code inside the library, or abandon the library. I am sure it can be done with ASP.NET AJAX, but it would require knowing how AJAX works, and how to interact with the library code.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Dear Graus,
Thanks a lot for your information.
I know some what, but I haven't played fully in it.
If you give me a reference, I will analyze and learn more.
Can you give me a link for overcoming this issue?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
ASP.NET/AJAX in Action is a very good book, the answer is probably in there.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
M. J. Jaya Chitra wrote: If the data is valid it has to update the DB else it has to given an alert.
AFAIAK, you can't register client script block from a updatepanel. You can put a label and set the error text there. So if there is any error, user will get the error message in the label than JS alert.
Hope this helps
|
|
|
|
|
Dear Navaneeth,
Thank you for your information.
But I want to get an alert.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I want to develop an application which will do the following
- Notify the user few mins ahead before we shut down server so he can save his work.
- Notify user few mins ahead before we bring down the applicaiton so he can save his work.
- I don't want to install anything on client side (service, active X etc).
- I don't want to put code on every page for doing this.
- Today i am implementing it for an application, tomorrow i might want to hook that for other application as well.
Any pointers/links/articles/resource in this direction will be greatly appreciated !
Thanks,
|
|
|
|
|
If it's an ASP.NET website, you'd need a web page that makes constant AJAX calls to find out if a shutdown is planned. A client side app would be far more suitable.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Based on your bullet points above, I am guessing you know the users logged into the application. In the event of a needed application or server shutdown, could you send an email notification to logged in users?
Another option ... are you using a master pages? You could consider placing a control in the header or footer which could display the status of an application or server shutdown.
|
|
|
|
|
ahmedel wrote: Another option ... are you using a master pages? You could consider placing a control in the header or footer which could display the status of an application or server shutdown.
That works, except that he seems to me to want to show a notification, he doesn't want the user to have to refresh a page to see it.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I don't want user to refresh the page.
|
|
|
|
|
Hello,
Thank you for reading this post. I am new to Javascript and ASP.NET development so please bear with me. I have a page that renders fine in IE but the same functionality gives me error in Firefox. I have a form which has a bunch of check boxes and there is a a particular checkbox lets call it ABC, and clicking on it, it needs to uncheck the other boxes, and if other check box is clicked, it shud uncheck the the ABC checkbox. My app works fine in IE but not in Firefox. I know there are a few keywords that is Microsoft proprietary, and is not all browser friendly, but i cannot figure out how to change it. Here is my code below. All help is appreciated.
function ValidateCheckedValues( ctrl , isChecked )
{
// Purpose : This function is called when the user clicks on any checkbox in the equipment requirements table on the page
// If the user clicks on the "ABC" checkbox it clears all the check boxes for that meeting,
// but if the user checked any other checkbox, it removes the check from the "ABC" checkbox
try
{
if( ctrl.parentElement.attributes("SubCode").value == "NONE" )
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
ctrl.checked = true;
}
}
else
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
if( ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).attributes("SubCode").value == "NONE" )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
}
}
}
}
catch( ex )
{
alert( ex.message );
}
}
|
|
|
|
|
what is the error ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
please note:this works fine in IE but throws errors like ctrl.parentElement has no properties.Please let me know what error is happening here. I changed the parentElement to parentNode and the children to childNodes but it just will not work for firefox. Iam a Software support person so do not have an indepth handle on the workings of .NET or Javascript.
Thank you.
|
|
|
|
|
"ctrl.parentElement.parentElement.parentElement"
Code like this is very bad. It assumes that the ctrl has 3 parents and will crash if it does not.
If your problem is in Firefox, you should download Firebug, which will let you debug your javascript inside firefox and see exactly what properties are present and what their values are.
Ridge Howison wrote: so do not have an indepth handle on the workings of .NET or Javascript
Then you're the wrong person for this job, why are you doing it ?
Why did my answer get voted as bad ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
1) parentElement should be parentNode [^]
2) IE tends to not insert text nodes for whitespace in the HTML; Firefox does. This doesn't normally make any difference, but your code is making some very specific assumptions as to how many children certain elements will have... this is probably going to trip you up sooner or later. Stop it. Either give the target elements id s and use document.getElementById()[^] to retrieve them, or get a library like jQuery[^] to help you traverse the DOM in a safe, sane manner.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
i have to open an excel reports in my web application
i have created all my reports and when i host my web application and tested my reports in client machine then my excel reports are not opening
i already configured dcom(for excel application launch and access rights) and iis
i am using win 2003 server iis 5.1
win xp client machine
Mohit
|
|
|
|
|
You need to send the excel file with response.binarywrite and hope your user has excel installed.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi All
I am working since 2 days to display images in a datalist and the code used is given below, but its not displaying the images.
I am storing path of the image in database in imagepath coloumn. Kindly help me please.
html code
---------------
<aspataList ID="dlImage" runat="server" RepeatColumns="3" Width="311px" Height="334px">
<ItemTemplate>
<asp:ImageButton ID="imgPhotos" ImageUrl='<%#Eval("imagepath")%>' Height="100%" Width="100%" runat="server" />
</ItemTemplate>
</aspataList>
c# code
----------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
cnOledb = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + strRootDir + "App_Data\\dbPhotos.mdb");
cnOledb.Open();
string strSelImages = "select imagepath from tblPhotos";
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(strSelImages, cnOledb);
da.Fill(ds);
dlImage.DataSource = ds.Tables[0];
dlImage.DataBind();
cnOledb.Close();
}
}
Thanks
wajid
|
|
|
|
|
Does te HTML look the way you expect it to ? Is the image path you're getting relative to the root of the app, the location of the control/page in question, both, or neither ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I am storing correct paths in database because whenever I am copying nd pasting any of the path in address bar of internet explorer, its showing the image, but when the same coloum of the database is linked to the datalist its not displaying the images.
I am getting some kind of small icons in datalist, but not the one which we generally get when we give wrong path like red x.
Thanks for your reply. Kindly help me with some good answer
|
|
|
|
|
OK - so you marked my answer as bad, and you hope I'll still help you ?
If you're seeing 'some sort of small icon', it's probably the image that's being pointed to. Look at your HTML to try to work out what's going on.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
problem is resolved. Actually I was storing the complete physical of my application in the database like D:\something\myapplicating\images\img.jpg that is why images in the datalist are not displayed. Hope this will help others
|
|
|
|
|
problem is resolved. Actually I was storing the complete physical path of my application in the database like D:\something\myapplicating\images\img.jpg that is why images in datalist are not displayed. I changed the path to images\img.jpg and it worked. Hope this will help others
|
|
|
|