|
I suggest you to use JavaScript AJAX.
Fire a JavaScript function on mouse over. Make a server call using Get/Post method and fetch response from Server.
Display the Details in Div tag. You need not to use any control for implementation.
function ajax_CreateXMLHttpRequest()
{
var xmlHttpRequest = null;
if (window.XMLHttpRequest)
{
xmlHttpRequest = new XMLHttpRequest();
}
else if (typeof ActiveXObject != "undefined")
{
xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlHttpRequest;
}
function ajax_MakeAnAJAXGetCall()
{
var dtDate = new Date();
var tURL= "";
tURL = "functions_AJAX.aspx?<argumentlist>"
ajaxObj = ajax_CreateXMLHttpRequest();
if (ajaxObj != null)
{
var URL = tURL;
ajaxObj.open("GET", URL, true);
ajaxObj.onreadystatechange = ajax_CallBack;
ajaxObj.send(null);
}
return false;
}
function ajax_CallBack()
{
if (ajaxObj.readyState == 4)
{
if (ajaxObj.status == 200)
{
var ajaxResponse = ajaxObj.responseText;
}
}
}
</argumentlist>
Make a call to function ajax_MakeAnAJAXGetCall on mouse over event.
|
|
|
|
|
I have a page that processes xml files. After processing, it then should move the files to a different location - thats not working now.
It uploads the files fine, processes them - but doesn't move. The message says: "Unable to find the specified file".
The code I am using is:
file.MoveTo(@"D:\MyArchive\badfiles\" + file.Name);
Here file is FileInfo object. The directory where I am trying to move it is a shared location, and the user have write permission.
Any idea why its failing?
Thanks.
Ekjon
|
|
|
|
|
Ekjon wrote: Any idea why its failing?
No. You hold all the cards in this game. You have access to the machine - verify that the destination path is valid, that the source file hasn't been processed and moved by a different thread, and that you aren't holding on to handles to the file from previous operations.
Then write a tiny program that does only what is necessary to reproduce the problem. Chances are, it'll work, and you can expand it to the point where it does all you need (or it breaks, thereby making it obvious to you where the problem lies...); if not, post the code and someone here may be able to help you.
Oh, and when you do, ask in the C# or .NET forum. This one is for web dev questions.
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
Hello Shog,
Thanks for your response. It is in fact a web application and the file needs to be processed then moved from the user input from the web. So I posted it here.
The paths are valid, definitely - otherwise I wouldn't ask for help.
Now - the prcessing and moving by a different thread? Not sure about that. I am using an XmlReader and after first round of reading - closing the reader. So when I read it next time, that works fine - but only doesn't move. I used same type of code from a Windows app, and moved the files fine.
Anyway, let me know if you can think of any other issue.
Thanks again.
|
|
|
|
|
Ekjon wrote: So when I read it next time, that works fine - but only doesn't move.
My best guess then, is that you have read access to the XML file but not delete access. Again, reduce your code until it works - eliminate any code reading from the file, any code that might be writing to the file, leaving only the move. If it works, then you have something holding onto a handle under normal operation. Otherwise, it's probably a permissions issue.
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
Thanks, I found it.
modified on Monday, October 27, 2008 5:23 PM
|
|
|
|
|
Hi,
I have an image, and I am trying to add a border around my image. The distance from the image to the border must be 5 pixels. My code is not working, not sure why.
Here is my HTML:
<img src="Images/sub_category_1.jpg" class="grey" />
Here is my style:
img .grey
{
padding: 5px; margin: 5px;
border: solid 1px #000;
}
What am I doing wrong?
Thanks
Brendan
|
|
|
|
|
I guess you should use
.grey
{
padding: 5px; margin: 5px;
border: solid 1px #000;
}
<img src="Images/sub_category_1.jpg" class="grey" />
|
|
|
|
|
This[^] should help.
Cheers,
Drew.
|
|
|
|
|
Hi,
I am working on a custom rich-text editor using contentEditable. When the return key is pressed I am preventing the default action, and inserting a line break tag to ensure that the browser doesn't create a paragraph element.
In IE I have this working great, but in Chrome, Safari, and FF the selection doesn't appear to update correctly. The break tag is inserted, but the input caret does not move. For test purposes I have replaced the break with a horizontal rule. Upon pressing enter, the caret should move after the HR element, but it doesn't.
<html>
<head>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
window.onload = function(event) {
document.observe('keydown', doc_keydown.bindAsEventListener(document));
}
function charCode(event) {
return typeof event.which !== 'undefined' ? event.which : event.keyCode;
}
function doc_keydown(event) {
var range;
var code = charCode(event);
switch (code) {
case 13: // return
if (document.selection) { // IE
range = document.selection.createRange();
range.pasteHTML("<hr />");
range.moveEnd("character", 1);
range.moveStart("character", 1);
range.collapse(false);
}
else { // FF, Google Chrome
range = window.getSelection().getRangeAt(0);
range.deleteContents();
var newNode = new Element("hr");
range.insertNode(newNode);
range.setStartAfter(newNode); // Doesn't work from here down.
range.setEndAfter(newNode);
range.collapse(false);
}
break;
default:
return true;
}
event.stop();
return false;
}</script>
</head>
<body>
<div contentEditable="true" style="border: solid 2px black; padding: 6px">
Some initial text - Edit Me!
</div>
</body>
</html>
Many thanks,
Lea Hayes
<div class="ForumMod">modified on Friday, October 24, 2008 6:39 AM</div>
|
|
|
|
|
Hello
I have worked on the same error earlier, but unfortunatly there is no way you can disable the keypress event in Firefox, Safari, etc. You can capture KeyPress events but they can only be controlled in IE.
I am sorry, i cannot help you on this topic.
|
|
|
|
|
I want to validate my conent with client side javascirpt regular expressions. words should not occur more than one time. ex ("one two one") here one comes more than one times, how to validate this using client side javascirpt regular expressions?
and another, "one" should not come after the term "only".ex "only one",
how to validate this using client side javascirpt regular expressions?
Known is a drop , Unknown is an Ocean
|
|
|
|
|
|
That is a good site. Don't forget about the Expresso tool found on this site.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Please give me the details about delegates and specify how to use in C# Console programs.
|
|
|
|
|
Please refer to
http://www.codeproject.com/KB/cs/Delegates_in_C_.aspx
In MSDN Refer
http://msdn.microsoft.com/en-us/library/ms173171(VS.80).aspx
|
|
|
|
|
Hey everyone,
recently I am workign on a project where people are able to search wines and later get them from my database. I store the variables from the search form in Session which i later retrieve in the next page (I couldnt use the query string here since its too small). However i get a problem in retrieving my data.
First of all my search field put the data to a session, here is the code.
public partial class catalogus : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BTNzoeken_Click(object sender, EventArgs e)
{
Session["searchkleur"] = DDLkleur.SelectedValue;
Session["searchland"] = DDLland.SelectedValue;
Session["searchdruifsoort"] = TXTdruifsoort.Text;
Session["searchregio"] = DDLregio.SelectedValue;
Session["searchjaar"] = TXTjaar.Text;
Session["searchinhoud"] = DDLinhoud.SelectedValue;
Session["searchprijs"] = DDLprijs.SelectedValue;
Session["searchoverig"] = TXToverig.Text;
Session["searchwijnnaam"] = TXTwijnnaam.Text;
Session["searchproducent"] = TXTproducent.Text;
Response.Redirect("resultaten.aspx");
}
}
After this i will arrive at the resultaten.aspx page which holds the following code
public partial class resultaten : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["searchkleur"] != null)
{
string VARkleur = Session["searchkleur"].ToString();
string VARland = Session["searchland"].ToString();
System.Convert.ToInt32(VARland);
string VARdruifsoort = Session["searchdruifsoort"].ToString();
string VARregio = Session["searchregio"].ToString();
string VARjaar = Session["searchjaar"].ToString();
string VARinhoud = Session["searchinhoud"].ToString();
string VARprijs = Session["searchprijs"].ToString();
string VARoverig = Session["searchoverig"].ToString();
string VARwijnnaam = Session["searchwijnnaam"].ToString();
string VARproducent = Session["searchproducent"].ToString();
LBLtest.Text = "Kleur " + VARkleur + "<br />Land " + VARland + "<br />Druifsoort " + VARdruifsoort + "<br />Regio " + VARregio + "<br />Jaar " + VARjaar + "<br />Inhoud " + VARinhoud + "<br />Prijs " + VARprijs + "<br />Overig " + VARoverig + "<br />Wijnnaam " + VARwijnnaam + "<br />Producent " + VARproducent;
}
}
}
and here's my aspx part with the SQL command:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ConnectionStrings:WijnhuisMDFConnectionString %>"
SelectCommand="SELECT [text] FROM [texten] WHERE textID = 26">
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BorderStyle="None"
DataSourceID="SqlDataSource2" GridLines="None" Width="240px">
<Columns>
<asp:BoundField DataField="text" HtmlEncode="False" SortExpression="text" />
</Columns>
</asp:GridView>
now i ve got 2 error messages: First one says that my landId cannot be converted to an integer so the session variable i stored as a string can't be converted to an int although i ve told C# to convert it.
2: i get an FormatException was unhandled y user code.
Does anyone know's whats wrong or how to solve it? I can share the project files if needed. Thanks in advance for your help
|
|
|
|
|
Ok, here is your problem I think.
string VARland = Session["searchland"].ToString();
System.Convert.ToInt32(VARland);
This means your VARland value is still stored in a string variable
try this
try
{
int32 VARland = System.Convert.ToInt32(Session["searchland"].ToString());
}
catch (Exception e)
{
....do something with your exception
}
I think your second error is because you have no try catch blocks and something is generating an exception
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am using safari 3.1.2 browser. I have problem with getting selected range object in safari.
for IE i used the function
document.selection.createRange();
it is working fine.
for sarafi i used the function
window.getSelection().getRangeAt(0)
but it always return the selected text not the range object.
I am in serious problem. Please help me.
Thanks in advance.
|
|
|
|
|
What is the difference between static internal int a=10
and
session["a"]=10
|
|
|
|
|
In which language ? PHP !
|
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
|