|
The only two ways that I know of to specify a post method (or get method for that matter) is in a form and XHTTPRequest object. There may be others but these are the two I use.
I don't know how you would do it in vbscript but in javascript I do it by sending the href and/or onclick events to a script. You can probably figure out how to do something like this in vbscript.
There is no reason why you cannot use javascript, unless you wanted to hone your vbscripting skills for your ciriculim vitae. I never really thought about you as a VB anything type of guy but from your recient posts I take it you are learning it.
I have never used the <link> tag but have used the address anchor tag like this in a menu bar.
<a class="nav" title="Process" href="javascript:jump('/process.htm');">Process</a>
I am pretty sure it will work on a <link> tag but just have never used it myself so you would have to try. In any case the <a> tag works just fine for navigation.
In the script you can submit a hidden form or process an XMLHTTPRequest to post parameters to the target page or server side script.
function jump(TARGET){
document.getElementById('parm1').value = 'Parm1';
document.getElementById('parm2').value = 'Parm2';
document.getElementsByTagName('form')[0].action = TARGET;
document.getElementsByTagName('form')[0].submit();
} // function jump(TARGET)
Where parm1 and parm2 are hidden input fields that you want to give values to in the script or you can alternatively set up an XMLHTTPRequest passing parameters to a server side script that will return the new body of the page. I use PHP on an Apache server so you would have to figure out how to do it in ASP or some other suitable server side scripting language in IISland.
That way you can setup an index.html (default.html) page and only ever have a path name in the address bar of the browser. If the user refreshed the page they would get the index.html (default.html) page again.
A bit more complicated but can be done something like this.
var Request = new getXMLHttpRequest();
Request.onreadystatechange = myReadyStateChangeHandler;
var parms= '';
function jump(TARGET){
Request.open("post", "http://" + location.host + TARGET + ", true);
Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
parms= "parm1=" + encodeURIComponent('Parm1')
+ "&parm2=" + encodeURIComponent('Parm2');
Request.send(parms);
} // function jump()
function myReadyStateChangeHandler(){
if (HTTPREQUEST_COMPLETED == Request.readyState){
if (HTTPREQUEST_SUCCESS == Request.status){
document.getElementsByTagName('body')[0].innerHTML = reply;
} // if (HTTPREQUEST_SUCCESS == Request.status)
else{
alert("Error: HTTP "
+ Request.status
+ " "
+ Request.statusText
+ " Please contact our WebMaster from the link on our Contact Us page explaining the error you received. Thank you.");
} // else [if (HTTPREQUEST_SUCCESS == Request.status)]
} // if (HTTPREQUEST_COMPLETED == Request.readyState)
} // function myReadyStateChangeHandler()
getXMLHttpRequest() is a homegrown script (javascript of course) that sets up the XMLHttpRequest object and defines the constant values HTTPREQUEST_COMPLETED and HTTPREQUEST_SUCCESS.
It determines if the browser has a native XMLHttpRequest object or if it is IE prior to IE7, in which case it returns an CaptiveX (Scott McNealy's name for ActiveX) object.
Google XMLHttpRequest and there are a gazillion examples, some probably even in vbscript. If you can't find something suitable email me and I will send you a copy of a script (javascrippt of course) that returns data asynchronously but you can change the third parameter in the XMLHttpRequest open method to false to make it operate synchronously.
-- modified at 12:14 Monday 14th May, 2007
|
|
|
|
|
You can easily submit a form using a plain hyperlink, but of course it does rely on javascript. Create your form element with method="post" and all necessary hidden (or otherwise) fields and give it a unique ID. You can then use document.getElementById("formid").submit() on the onclick event of the hyperlink (or better yet, the onfocus event). Alternatives to this are document.forms[0].submit() and the like but I'm not sure of cross browser issues with that. If you keep the href attribute with your current method (query string params) this will also work without javascript.
Hmm, just read the above post in full (I know, I should done that first...) and the first method is similar. BTW, the <a> tag is an 'anchor' tag not 'address', and the <link> tag is for linking external documents such as style sheets, normally when people say a link they mean an anchor tag.
|
|
|
|
|
These links are not part of a form.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
JimmyRopes wrote: There is no reason why you cannot use javascript, unless you wanted to hone your vbscripting skills for your ciriculim vitae. I never really thought about you as a VB anything type of guy but from your recient posts I take it you are learning it.
The *only* reason I'm using vbscript is because I was told not to convert it to .Net (and C#). In other words, I have no choice because the boss said to use vbscript.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Hi,
I would like to know "how to write code in .net using the .net connector that will recive Idoc's from a SAP System?".
Can Biztalk do this without writing .net code ? I have used the "SAP Adapter for Biztalk" and have been able to download the IDoc schemas. Now that i have the schemas, i would also need the Idocs. Thus i will reframe my question again "How can i receive the Idocs from the SAP System to BizTalk?. "
Any pointers on this would be extremely useful.Please help me.
|
|
|
|
|
Am new but know a little more in web design.am a vb/sql programmer.am requested to Build a website, and i have to keep track of number of users accessing the site,time,location,browser type,ip, city,Country.i have to give these reports Every month and e-mail it to users monthly and be able to retrieve the reports daily and weekly
help how do i start. i have web design knowledge.
Vuyiswa
|
|
|
|
|
|
So you mean i should use, Templates?
Vuyiswa
|
|
|
|
|
No templates - just a small bit of javascript on each page, and you can then view reports online (some graphical) and have summaries emailed to you.
Read the info on the website!
F
|
|
|
|
|
Thank Man you are a Star
Vuyiswa
|
|
|
|
|
Two quick questions:
1. I really love Mozilla Firefox's javascript.options.strict mode (type about:config in addressbar). However it still doesn't pick up on certain things such as making it compulsory to have semi-colon as a statement terminator. I have hundreds of organically grown JavaScript files that are millions lines long. They are not written by me but by former employees and I've been handed the job of debugging & fixing their code. Does anyone know of a good Very strict JavaScript syntax verifier checker? What is the best JavaScript IDE out there?
2. What happens if I keep on writing:
var control = new Control();
var control = new Control();
var control = new Control();
500 times? Will this cause a memory leak? Or will the previous object be deleted since the reference is lost? Or is it handled differently in IE & FF?
|
|
|
|
|
there wont be any memory leak it is handled by DOM it will consider the last
var control = new Control();
|
|
|
|
|
Hello,
I'm new to the web development world and I'm hoping someone can point me in the right direction.
I have an asp.net website (I'm using a starterkit from www.asp.net). I want to apply a different stylesheet if the client is a mobile device. I'm using a plugin that gives me the client device's display settings. If the display is below a certain resolution I want to use mobile.css. Otherwise, I want to use default.css.
My understanding is that the style gets applied on the server when a request is made, and the resulting html is returned to the client. But I want the decission as to what style gets applied to be made by the client. How can I go about using javascript to change the stylesheet on the fly? Or, if I'm barking up the wrong tree, is there a way for me to program this functionality in the codebehind (I don't think there is, as the decission would have to be made on the client...)?
Thanks for your help! (I'm a total noob in this area!)
Ian
|
|
|
|
|
u can do it in ur client script by adding dynamic CSS and removing old one. And also donot cache the css in client side. use CacheControl=no-cache for that CSS probaly in IIS as a header.
|
|
|
|
|
Does the CSS need to be embedded in the HTML? Or can it just be linked to CSS on the server?
Ian
|
|
|
|
|
You can use the 'link[^]' tag to identify the CSS file, with the media attribute specifying what device the file should be used for.
|
|
|
|
|
Thanks! I'll give this a try.
Ian
|
|
|
|
|
ibowler wrote: I want to apply a different stylesheet if the client is a mobile device.
Put something like this in the <head> section of the page.
<style type="text/css" media="all">
@import "./styles/layout.css";
@import "./styles/presentation.css";
</style>
<style type="text/css" media="screen">
@import "./styles/screen.css";
</style>
<style type="text/css" media="print">
@import "./styles/print.css";
</style>
<style type="text/css" media="handheld">
@import "./styles/handheld.css";
</style>
CSS 2 Media Types[^]
The media=all would be a general layout (header, body, footer, navigation, etc.) and presentation (color, background, etc.) for any media and the specialized by device style sheets override the things specific to the particular device.
|
|
|
|
|
Hi all,
I have this big problem with hyperlinks I would appriciate any help please.
My web site has two datagrids on the same page. And one has a list of names of the users which are in a HyperlinkColumn. The second datagrid is for inserting data, and when a user inserts data I used 'Windows Authentication' for names in one column called Name.
Now this is how it's supposed to work: When any user want to see data about a particular user it's a matter of selecting his name and the data Writen by the selected user should be the only ones to be shown.
I got some examples on Google but they all seem not to be working. When a user is selected the URL changes instead of the particular rows in the datagrid to be selected. For example the original url is "http://localhost/Dash_Board/DashBoard.aspx" and if I select user Claude the URL change into "http://localhost/Dash_Board/Claude" and get an error The page cannot be found. Why would this be happening?
My code looks like this:
HTML part:
<Columns>
<asp:HyperLinkColumn Target="_self" DataNavigateUrlField="TeamBilling" DataTextField="TeamBilling" HeaderText="Billing" DataTextFormatString="{0:c}"></asp:HyperLinkColumn>
</Columns>
and code behind:
private void dgbilling_SelectedIndexChanged(object sender, System.EventArgs e)
{
SqlCommand myCommand = new SqlCommand("select * from dbo.DashBoard where Name = @Billing",con);
SqlParameter myparam = new SqlParameter("@Billing",SqlDbType.Text);
myparam.Value="../Dash_Board/DashBoard.aspx?,Name{0}";
myCommand.Parameters.Add(myparam);
SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds);
dgis.DataSource=ds;
dgis.EditItemIndex = -1;
dgis.DataBind();
}
dgis: this is the datagrid that where user inserts data.
dgbilling: this is the hyperlinkcolumn.
Thanks.
|
|
|
|
|
Replace hyper link with this and write the code on datagrid item command & find the name from command Argument
asp:LinkButton ID="lbtnName" Runat="server" Text="NAme" CommandArgument="Selected Name"/asp:LinkButto>"
-- modified at 9:02 Friday 11th May, 2007
|
|
|
|
|
Hi.
Is there a way to provide the same kind of tooltip that you get with a hyperlink (ie; a hand hovering over the text and a synopsis of the meaning of that text/statement; without defining a hyperlink. So, in short; a hyperlink-like-tooltip without the hyperlink?
Thanks in advance.
James
|
|
|
|
|
|
Thank you very much for the pointers..
James
|
|
|
|