|
|
I went to the msdn website:http://msdn.microsoft.com/en-us/library/system.net.networkinformation.aspx
looking for help writing the code in VB.
|
|
|
|
|
Do you have any concrete question or problem while implementing your method?
|
|
|
|
|
I have a selection in my ASP page (please see codes):
1. I would like the fisrt time it will show the defaut selection the picture on the right-side (select of "0"), but when the web-user change any other, then the picture will be refresh accordingly
2. If #1 can't be used (can't recognize seclection changed), can we add a button or tag "REFRESH PICTURE" so that the web-user can select to refresh after changing the selection?
3. If #2 also can't be done ... is there other way to refresh the picture without jumping to another page?
Thanks to any help
*) I insert Request("Picture"), just in case I have to use a mean to jump back the same page & get the new selection!
<body>
<%
Dim str_image, request_select
request_select = Request("Picture")
If request_select = "0" Then
str_image = "image/Picture0.jpg"
ElseIf request_select = "1" Then
str_image = "image/Picture1.jpg"
ElseIf request_select = "2" Then
str_image = "image/Picture2.jpg"
Else
str_image = "image/Picture3.jpg"
End If
%>
<table id='outtertable'>
<form action="NextPage.asp" method="post" name="myForm" >
<tr>
<td>
<table id='datatable'>
<tr>
<td>Select picture</span></td>
<td>
<select name="Picture" size="1" id="Picture">
<option value="0" >Picture 0 </option>
<option value="1" >Picture 1 </option>
<option value="2" >Picture 2 </option>
<option value="3" >Picture 3 </option>
</select>
</td>
</tr>
</table>
</td>
<td>
<table id='buttontable'>
<tr>
<td><img src =<%=str_image%> width="100" height="100"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><input type="submit" value="Next Page"></td>
</tr>
</form>
</table>
</body>
|
|
|
|
|
You can use a javascript timer to force your page to refresh itself. Or you can use AJAX to make a call to request a new URL to show in the img tag.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
- With the timer: I will have other problems. My example codes are only partial of the web-user entries, if I use the Timer to refresh the page ... means all web-users are typing are lost (or I have to save all present entries before refresh). Also if I want to update as the web-user selecting the new picture, that means the refresh should be within 1 second --> the sreen will keep refreshing constantly, it is not very good!
- I have never used the AJAX, your guide looks close to the:
function poptastic(url)
{
newwindow=window.open(url,'name','height=500,width=600');
if (window.focus) {newwindow.focus()}
return false;
}
If it is true, then I still have the problem that I must know the new web-user picture selection in the same page & refresh the old with the new one at the same spot ... which I don't know how to get it without to jump to the new page to use the Request("Picture")
Any further help?
|
|
|
|
|
function changeImage() {
var img = document.getElementById('img');
var foo = new Date;
img.src = "a.jpg"+ foo.getTime();
}
|
|
|
|
|
Might be I not uderstand well ... did you mean:
When web-user click on the Image link, then it will invoke the script (changeImage) & show the desired image (a.jpg)?
If yes, then I have the problem: With your codes, I must know which picture I have to show first! My problem is that I have to wait someone change the selection (the same page) & I don't know how to read the new selection without jumping to a new page
Might be I understand in-correctly?
|
|
|
|
|
For this to work you would use your script to save whatever picture you wanted as "a.jpg". adding the time after the filename ensures you do not end up with a cached version of the image.
Fix:
This line:
img.src = "a.jpg"+ foo.getTime();
should be:
img.src = "a.jpg?"+ foo.getTime();
|
|
|
|
|
Sorry about my understanding, as I mentioned before ... I don't know which picture to place as you mentioned! I must somehow knowing the web-user select the new one in the SELECT tag to replace new picture on right-side at the same place (please see my original codes)!
And I still don't have the way to acknowledge the change of the SELECT tag within the same page, by any chance you modify my codes & it works as you mention?
Many thanks for be patient with me
|
|
|
|
|
Ah.
Javascript to get selected index of a select tag:
<script>
var dropdown = document.getElementById("mySelectElement");
var index = dropdown.selectedIndex;
if (index == 0){
alert("a");
} else if (index == 1){
alert("b");
}
</script>
Then in your html:
<select id="mySelectElement">
<option>a</option>
<option>b</option>
</select>
|
|
|
|
|
Hi Marc,
Thanks for the codes, I am able to get the SELECT tag now & I will try to replace the old picture with the new picture as other suggestions
|
|
|
|
|
I have made a Silverlight application which use a WCF webservice. I works fine but there is a small problem.
The background:
I run a gameserver and the game saves a resultfile which is updated in an interval (can be set).
I have a webpage with a Silverlight app. The SL app uses webservice to update some data on the client, with an automatic update every 20 seconds or so. Also works fine.
The Webservice parse the file from the game and that's no problem.
But I realize that if, let's say, 50 ppl go to the page and just watch the SL app update, the webservice parses the file 50 times every 20 seconds! Not good...
Here is how I want it to go:
The client calls the webservice and gets the already parsed file as data. And the parsing/reading the file will update in the background and store the data to be ready for transfer to the client.
But how do I make my webservice parse the file without the client calling the service?
I actually don't know how to pass this problem... not an webservice expert either
Any tips and was I clear enough?
|
|
|
|
|
We have a similar issue where we have a large block of data that displays on a dashboard. It can be accessed by 1..N clients and involves some complex queries and therefore we don't want to be re-running it each time the request is made.
The solution is to cache on the server side.
There are several ways to tackle this. I would start by abstracting your service with an interface (should be doing this already) and then having the interface also receive a cache interface, ICache.
You can make it simple, for example, perhaps you construct it with a factory like this:
ICache cache = CacheFactory.RetrieveCache(TimeSpan lifespan);
This gives you flexibility for how long it is cached.
Then, you might use the ASP.NET Web Cache - take a look here for some exhaustive examples/solutions:
Exploring Caching in ASP.NET[^]
Another option is to use the Singleton pattern and create a static class with a "lastcached" date and the parsed file.
Basically, you expose a method "getparsedfile" and the method checks the lastcached. If it was cached less than you interval, it will simply return the cached object, otherwise it locks the object, updates the date and then re-parses the file.
Hope that makes sense!
|
|
|
|
|
hi all
I have create a virtual directory under IIS6 and windows server 2003
now my environment is like
my server(where IIS is configured) is under MAIN Domain
and
when I try to use the site from client machine(win XP) it will promp me for passowrd authentication
what should i do ???
should i give impersonation to my virtual directory
if YES then which User should i put in impersonation
Domain user or application server user
what to do ????
thankx in advance
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Do you even need domain authentication enabled? If your site doesn't do anything with domain usernames or passwords, simply disable Windows Authentication on the virtual directory.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
In your IIS, right click the Virtual Directory --> Properties --> Directory Security --> Click on Edit button in the section Authentication and Access Control --> Check the Enable Anonymous Access checkbox,
Deselect Integrated Windows Authentication.
This should solve the issue. Hope you have not set any Windows Authentication code in your web application. Else you need to look into that as well.
|
|
|
|
|
What is the @ Blocks for in the CSS document outline within Visual Studio (2008)?
Todd Smith
|
|
|
|
|
how to fetch historical data from nseindia.com and write in a .txt file ? example:-http://nseindia.com to http://lala.com/yaka.txt
|
|
|
|
|
You can't, obviously. Not unless they offer such a service through a webservice.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi everyone,
This is a brief question which Im sure has an easy answer, but one that I cant see!
I have a .png page overlay in the lightbox style that I want to display when a user carries out various actions. The problem I am having is that although it covers the entire page on my monitor (a 1440 x 900 resolution) when I view it on a different resolution (say 1024 x 768) it no longer stretches to the full length. It appears that although the .png image is repeated 100% vertically and 100% horizontally that it only covers the viewable area. Anything below this that requires scrolling to get to is not covered by the overlay.
Does anyone have any thoughts on why this might be happening and what I can do to fix it?
Cheers, Bryant
|
|
|
|
|
Unless someone has a better suggestion (pure CSS) I have resolved this by using JS to obtain the window height and width (and max scroll areas) and then dynamically setting the overlay height and width with these values.
|
|
|
|
|
Hi,
I am developing AJAX supported web application. Previously I had .Net Framework 2.0 with Visual Studio 2005 and for that I installed ASP .Net 2.0 AJAX Extension to use AJAX controls in application. At that time it was worked properly.
But now I have upgraded my Framework to .Net Framework 3.5 with Visual Studio 2005, I have uninstalled previously installed AJAX Extension. And want to use the AJAX controls provided by .Net Framework 3.5, so I added these controls to Toolbox. But unfortunately when I am going to use these controls it is still referencing to the previous version. I checked in web.config for assembly version, but it is referencing to the previous version.
Afterall I am not able to use these AJAX controls provided by .Net framework 3.5.
Anybody have solution on this problem.
Pravin
|
|
|
|
|
You can go to www.allegianceauto.com/termsbarry/ and you will see that there is a "<" at the top. Now if you go into the source code, there is nothing there. But wait... if you just go into firefox and actually highlight it and select view se;ection source, then you will see something that for whatever reason isn't there when just looking at the. There is a & lt there. I have separated the & and lt sections so it won't print it out. I emphasize that this isn't there when you go to look at the source code the normal way. Matter of fact this is the only way I have been able to find anything. I have put the whole html code as it sits on the server in a text file at http://allegianceauto.com/termsbarry/test.txt[^]. If someone could at least put me in the right direction, this would be immensely appreciated.
|
|
|
|
|
what about
<form id="form1" name="form1" method="post" action="/terms2/">
<<table ...
Remove the < before <table tag.
|
|
|
|