我有一個已發佈並在服務器上工作的Web應用程序。我有aspx文件,但我沒有.vb文件。我需要在應用程序中編輯單個頁面。我怎樣才能達到.vb文件?或者更好地說,如何在應用程序中編輯我想要的部分?缺少已發佈的ASP.NET應用程序的源代碼
編輯: 這裏是我的aspx文件:
<%@ page language="VB" autoeventwireup="false" inherits="UrunRapor, App_Web_hfev-r-q" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %><%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3.Export, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dxwgv" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Ürün Detaylı Rapor</title>
<script language="javascript">
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="font-size: 9pt; width: 474px; font-family: Calibri">
<tr>
<td style="width: 100px; height: 22px">
Ay</td>
<td style="width: 100px; height: 22px">
<asp:DropDownList ID="cboMonth" runat="server" BackColor="#FFFFC0" Font-Bold="True"
Font-Names="Calibri" Font-Size="9pt">
<asp:ListItem Selected="True" Value="%%">[..]</asp:ListItem>
<asp:ListItem Value="1">January</asp:ListItem>
<asp:ListItem Value="2">February</asp:ListItem>
<asp:ListItem Value="3">March</asp:ListItem>
<asp:ListItem Value="4">April</asp:ListItem>
<asp:ListItem Value="05">May</asp:ListItem>
<asp:ListItem Value="06">June</asp:ListItem>
<asp:ListItem Value="07">July</asp:ListItem>
<asp:ListItem Value="08">August</asp:ListItem>
<asp:ListItem Value="09">September</asp:ListItem>
<asp:ListItem Value="10">October</asp:ListItem>
<asp:ListItem Value="11">November</asp:ListItem>
<asp:ListItem Value="12">December</asp:ListItem>
</asp:DropDownList></td>
<td style="width: 100px; height: 22px">
Yıl
</td>
<td style="width: 100px; height: 22px">
<asp:DropDownList ID="cboYear" runat="server" BackColor="#FFFFC0" Font-Bold="True"
Font-Names="Calibri" Font-Size="9pt">
<asp:ListItem Selected="True" Value="%%">[..]</asp:ListItem>
<asp:ListItem Value="2007">2007</asp:ListItem>
<asp:ListItem Value="2008">2008</asp:ListItem>
<asp:ListItem Value="2009">2009</asp:ListItem>
<asp:ListItem Value="2010">2010</asp:ListItem>
<asp:ListItem>2011</asp:ListItem>
<asp:ListItem>2012</asp:ListItem>
<asp:ListItem>2013</asp:ListItem>
<asp:ListItem>2014</asp:ListItem>
<asp:ListItem>2015</asp:ListItem>
</asp:DropDownList></td>
<td style="width: 100px; height: 22px">
<asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
Text="Sorgula" /></td>
<td style="width: 100px; height: 22px">
<asp:Button ID="Button2" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
Text="Excel'e aktar" /></td>
<td style="width: 100px; height: 22px">
<asp:Button ID="Button3" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
Text="PDF dosyasına aktar" Width="123px" /></td>
</tr>
</table>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CRRConnectionString %>">
<SelectParameters>
<asp:ControlParameter ControlID="cboMonth" Name="Month" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="cboYear" Name="Year" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
<dxwgv:aspxgridview id="dgCRR" runat="server" datasourceid="SqlDataSource1">
<Settings ShowFilterRow="True" ShowFilterRowMenu="True" ShowFilterBar="Visible"
ShowGroupedColumns="True" ShowGroupPanel="True"></Settings>
<SettingsPager Visible="False" PageSize="1000" Position="TopAndBottom"></SettingsPager>
</dxwgv:aspxgridview>
<dxwgv:ASPxGridViewExporter ID="ToExcel" runat="server">
</dxwgv:ASPxGridViewExporter>
</form>
</body>
</html>
她是我想用
Imports System.Globalization
Partial Class UrunRapor
Inherits CRR.RequestBase
Dim SelCmd As String
Dim MyUser As String
Dim dtreg As Data.DataTable
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MyUser = Request.ServerVariables.Get("LOGON_USER")
If Not Page.IsPostBack Then
Dim dareg As Data.SqlClient.SqlDataAdapter = New Data.SqlClient.SqlDataAdapter
dareg.SelectCommand = select_User(Request.ServerVariables.Get("LOGON_USER"))
dareg.SelectCommand.Connection = cnn
dtreg = New Data.DataTable
dareg.Fill(dtreg)
If dtreg.Rows.Count = 0 Then
Response.Redirect("NotAuthRep.aspx")
End If
'Exit Sub
'dgCRR.DataBind()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
FillGrid()
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
FillGrid()
ToExcel.FileName = "CRR-Product.pdf"
ToExcel.WritePdfToResponse("CRR-Product.pdf")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
'ToExcel.FileName = "CRRNew"
'ToExcel.DataBind()
FillGrid()
ToExcel.GridViewID = "dgCRR"
ToExcel.WriteXlsToResponse()
End Sub
Protected Sub FillGrid()
SelCmd = "SELECT tblCRRProductDetails.CRRId, tblCRRProductDetails.ProductCode, tblCRRProductDetails.ProductName, tblCRRProductDetails.Batch, tblCRRProductDetails.ExpireDate, tblCRRProductDetails.Qty, tblCRRProductDetails.SalesUnit, tblCRR.CrrCaptureDate, tblCRR.RegistrarName, tblCRR.CustomerCode, tblCRR.CustomerName, tblCRR.Channel, tblCRR.ClaimerName, tblCRR.ClaimerAddress, tblCRR.ClaimerPhone, tblCRR.ClaimerMail, tblCRR.CaseDetails, tblCRR.RsDeptName, tblCRR.ReasonName, tblCRR.RsPerName, tblCRR.ExpecRsDay, tblCRR.ExpecRsDate, tblCRR.RsDescription, tblCRR.ResolutionDate, tblCRR.ClaimResult, tblCRR.ActionPlan, tblCRR.ClosedPerName, tblCRR.ClosingDate,tblCRR.Status FROM tblCRRProductDetails INNER JOIN tblCRR ON tblCRRProductDetails.CRRId = tblCRR.CrrID WHERE (MONTH(CrrReceiveDate) LIKE '" & cboMonth.SelectedItem.Value & "') AND (YEAR(CrrReceiveDate) LIKE '" & cboYear.SelectedItem.Value & "')"
SqlDataSource1.ConnectionString = "My Connection String"
SqlDataSource1.SelectCommand = SelCmd
dgCRR.DataBind()
End Sub
End Class
我相信這會導致一個很好的解決方案,但我在實施它時遇到困難。我編輯了我的問題並添加了我的aspx文件。我還添加了我希望這個aspx頁面使用的代碼。你能指導我通過嗎? – HOY 2013-05-07 08:11:49
有什麼困難? PS:不要忘記頁面中的名稱空間聲明'Inherits'屬性。 – 2013-05-07 08:16:51
我的aspx文件就像上面那樣:inherits =「UrunRapor,App_Web_hfev-rq」,我應該將它更改爲inherits =「NewVersionUrunRapor,App_Web_hfev-rq」,那麼應該如何修改我的vb代碼(部分類UrunRapor,部分類NewVersionUrunRapor),這部分我也沒有得到(你可以放在任何。你在bin目錄中部署的DLL程序集),我不知道該怎麼做。 – HOY 2013-05-07 08:36:30