0

I have trouble Application_Start() between 2 project. Here is Application_Start() MVC4 in Global.asax.cs

public partial class MvcApplication : System.Web.UI.Page
{
    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}

Here is Application_Start() asp Webform use visual basic in Global.asax

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)


    Application("A2BasePage") = "Default.aspx"

    Application("GvTableTitleColor") = "#003366"
    Application("GvCaptionColor") = "#000000" '"#FFFFFF"
    Application("GvCaptionBackColor") = "#C0C0C0" '"#336699"
    Application("GvSystemBackColor") = "#F0F0E1"


    '---Global Color
    Application("GvTableTitleColor") = "#003366"
    Application("GvCaptionColor") = "#000000" '"#FFFFFF"
    Application("GvCaptionBackColor") = "#C0C0C0" '"#336699"
    Application("GvSystemBackColor") = "#F0F0E1"
End Sub

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
    ' Code that runs on application shutdown

End Sub

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
    ' Code that runs when an unhandled error occurs
End Sub



Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    Session.Timeout = 180

    Session("RapidISDBType") = "SQLServer"
    Session("RapidISUserIDPassword") = "User ID=xx;Password=xx"
    Session("RapidISServerName") = "x.x.x.x"
    Session("RapidISDBName") = "xx"

    Dim strDefaultAppName As String = ""
    If Session("GvAppName") <> "" Then
        strDefaultAppName = Session("GvAppName")
        strDefaultAppName = "xx"
    Else
        strDefaultAppName = "xx"
    End If

    Dim objA2Global As xx
    'objA2Global = New xx
    If objA2Global.SetAppSessions(xx, Session("RapidISServerName"), Session("Rxx"), Session("xx"), Session, True) Then
        'ErrorMsg.Text = ""
    Else
        'ErrorMsg.Text = "No Data In Records"
    End If


End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    ' Code that runs when a session ends. 
    ' Note: The Session_End event is raised only when the sessionstate mode
    ' is set to InProc in the Web.config file. If session mode is set to StateServer 
    ' or SQLServer, the event is not raised.
End Sub

How to intergrate two files. Please help me.

Daniel Dušek
  • 13,683
  • 5
  • 36
  • 51
  • 1
    What are you trying to do? Those are two different languages targeting two different platforms. – Tim Mar 02 '17 at 03:40
  • I want intergrate 2 platform in one project – Nguyễn Tuấn Anh Mar 02 '17 at 03:43
  • You can convert existing webforms VB code into C# version, then add all required MVC references (read these posts: http://stackoverflow.com/questions/2203411/combine-asp-net-mvc-with-webforms and http://stackoverflow.com/questions/27553305/how-to-enable-mvc-in-a-webforms-project). – Tetsuya Yamamoto Mar 02 '17 at 09:13

0 Answers0