简体   繁体   English

将AJAX功能的URL / IP地址更改为静态

[英]Changing the URL/ IP address of the AJAX function to be static

Now, I have a web application made using [html, asp.net, sql server,javascript & ajax]. 现在,我有一个使用[html,asp.net,sql server,javascript&ajax]制作的Web应用程序。 As usual I use ajax to send data to the server using the aspx page. 像往常一样,我使用ajax使用aspx页面将数据发送到服务器。 My Application is working fine, but I want to deploy it on Android. 我的应用程序运行正常,但我想在Android上部署它。

The asp urls I use at the ajax function are: 我在ajax函数中使用的asp网址是:

 url:'http://localhost:49169/xxxxx.aspx'

As you can see, this won't be working on the mobile coz the url changes everytime. 如您所见,URL每次更改都不会在移动设备上起作用。 So what should I do in order to change the url and IP Address to make them static & take the new configurations of the IP without recompiling the project ? 那么,如何更改url和IP地址以使其变为静态并采用IP的新配置而不重新编译项目呢?

Thanks. 谢谢。

It depends upon which version of visual studio you are using. 这取决于您使用的Visual Studio版本。 But the general gist is that you can set the port from "using dynamic port" which it chooses one for you eg 49169 to a fixed port which you can specify. 但是一般的要点是,您可以将端口设置为“使用动态端口”,该端口可以为您选择一个端口,例如49169,可以指定为固定端口。

Here are the intructions for vissual studio 2008, I believe it's the same intructions (or very similar) for other versions of visual studio: http://msdn.microsoft.com/en-us/library/ms178109%28v=vs.90%29.aspx 以下是vissual Studio 2008的说明,我认为与Visual Studio其他版本的说明相同(或非常相似): http : //msdn.microsoft.com/zh-cn/library/ms178109%28v=vs.90 %29.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM