0

私は ASP Web アプリケーションを作成しています。下部に更新ボタンがあります。更新ボタンをクリックすると、テーブル内の 2 つのセルからデータを取得することになっています (1 つはチェックボックスで、もう 1 つはテキスト入力です (値は double になります)。値を取得する JavaScript 関数を作成しました。チェックボックスのチェックボックスをオンにして、更新された URL 文字列の残りの部分に挿入します。

<script>
function getUpdateHTML()
{

var updatestring = "window.location='RollInventoryViewDev.asp?YNChecked=";
updatestring = updatestring + document.getElementById("cellRollLockoutYN").checked + "&";

updatestring = updatestring + "action=update&sort=roll_id&sortdir=<%=intSortDir%>&id=<%=intRollID%>&iddt=<%=StrRollIdDt%>&seqnum=<%=intRollSeqNum%>&findesc=<%=strRollFinishDescription%>&fincd=<%=strRollFinishCD%>&diam=<%=dblRollDiameter%>&crown=<%=dblRollCrown%>&crownaim=<%=dblRollCrownAim%>&prosrough=<%=intRollProsRoughness%>&peaksrough=<%=intRollPeaksRoughness%>&hardness=<%=intRollHardness%>&metalcd=<%=strRollMetalCD%>&rolltype=<%=strRollType%>&lockout=<%=chrRollLockoutYN%>&depthavg=<%=dblProductPatternDepthAvg%>'";
return updatestring;
}
</script>

呼び出される場所は次のとおりです。

<input type=button value="Update" onClick="getUpdateHTML()"></input>

関数が実行された後、文字列を実行します。したがって、たとえば、関数は次を返す場合があります。

RollInventoryViewDev.asp?YNChecked=true&action=update&sort=roll_id&sortdir=0&id=9307&iddt=1/1/1995&seqnum=89&findesc=VIT&fincd=VIT &diam=24.651&crown=0.0041&crownaim=&prosrough=225&peaksrough=150&hardness=832&metalcd=2FST&rolltype=Work&lockout=Y&depthavg=1.5

その URL でページをリロードしたいのですが、それを実現する方法がわかりません。

愚かな質問で申し訳ありません。Javascriptを使用するのはこれが文字通り初めてです。ASP を使用してこれらすべてを実行できることを望んでいましたが、Javascript で実装する方が簡単であると判断しました。

4

2 に答える 2

5

JavaScriptを使用して新しいアドレスを開くには、これを使用しますwindow.open("newurl.asp?...","_self")

于 2013-06-26T15:10:47.257 に答える