をリダイレクトするためのページ、.NETは、Visual Studio 2010のフィラーC#を使用して外部URL
私はGridViewの上のハイパーリンクをユーザーがクリックするnavigationurlは、手順 1つの呼び出しWebサービスを使ってその場で作成されなければならない状況があるといくつかの値を渡して、コントロールのナビゲーションURLにアタッチする必要がある新しいidkeyを受け取ると、これはRowDataBoundイベントの下で実行されますが、グリッド内の各行に対してwebserviceに無駄な呼び出しを行います。代わりに、ユーザーがリンクをクリックしたときにこれを実行したいのですか?
私が考えている別のアイディアは、ページをリダイレクトする間にページを使うことですが、それは自動提出する必要がありますか?これに任意の手がかり???またはより良いやり方?
おかげ
<asp:GridView ID="GridViewLinkedService" runat="server" AutoGenerateColumns="False" DataKeyNames = "applicationId"
DataSourceID="ObjectDataLinkedService" Height="213px" Width="897px">
<Columns>
<asp:BoundField DataField="applicationId" HeaderText="Application ID" Visible ="true"
SortExpression="applicationId">
<HeaderStyle BackColor="#4B6C9E" BorderStyle="Solid" Font-Bold="True"
Font-Names="Verdana" Font-Size="Small" ForeColor="White" />
<ItemStyle Width="10px" />
</asp:BoundField>
<asp:BoundField DataField="referenceNumber" HeaderText="Reference Number"
SortExpression="referenceNumber" >
<HeaderStyle BackColor="#4B6C9E" BorderStyle="Solid" Font-Bold="True"
Font-Names="Verdana" Font-Size="Small" ForeColor="White" />
<ItemStyle Width="30px" />
</asp:BoundField>
<asp:BoundField DataField="applicationName" HeaderText="Application Name"
SortExpression="applicationName" >
<HeaderStyle BackColor="#4B6C9E" BorderStyle="Solid" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ForeColor="White"/>
</asp:BoundField>
<asp:BoundField DataField="address" HeaderText="Address"
SortExpression="address" >
<HeaderStyle BackColor="#4B6C9E" BorderStyle="Solid" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ForeColor="White" />
</asp:BoundField>
</Columns>
Hyperlink column is added in the Pageload
HyperLinkField LinksBoundField = new HyperLinkField();
string[] dataNavigateUrlFields = {"link"};
LinksBoundField.DataTextField = "link";
LinksBoundField.DataNavigateUrlFields = dataNavigateUrlFields;
**LinksBoundField.NavigateUrl; //call webservice(send appid and refno) and append newtoken to url (reieved from datasource link)**
LinksBoundField.DataNavigateUrlFormatString = "http://" + Helper.IP + "/" + Helper.SiteName + "/" + Helper.ThirdPartyAccess + "?value={0}&token=" + Session["Token"];
LinksBoundField.HeaderText = "Link";
LinksBoundField.Target = "_blank";
GridViewLinkedService.Columns.Add(LinksBoundField);
GridViewLinkedService.RowDataBound += new GridViewRowEventHandler(grdView_RowDataBound);
ここからASHXファイルの代わりに、ASPXを使用してのヒントを得た、非常によく
おかげで動作します10? – Polity
@Polityはおそらくビジュアルスタジオ2010を意味します – Aristos
@Polity yes VS 2010 – Gauls