Advertisement

12.13.2007 at 11:39AM PST, ID: 23021928
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Convert Classic ASP to C# Object Oriented Class

Asked by jtwoods4 in Microsoft Visual C#.Net, C# Programming Language, WebApplications

Tags: , , , ,

I have a classic ASP page that reads the variables in the QueryString and uses a series of case statements to determine what content to display based on the Querystring variables. The case statements are very large and complex with nested case statements.

I need to convert this page to C# ASP.NET utilizing an object oriented approach. Does anyone have an idea as to the best way to do this. Below is an example of the old ASP page

<%
Dim phone, id, st, dir, atlas, version, pricepoint, va, spotlight
      version = "nobundle"
      phone = "1-877-460-2DSL"
      id = Request.QueryString("id")
      st = Request.QueryString("st")
      dir = Request.QueryString("dir")
      atlas = "VZB_VOL05_JDPOWER_HOME"
      pricepoint = "39.99"
      va = false
      spotlight = "<script language=""JavaScript"" type=""text/javascript"">" & vbCrLf &_
                                            "var axel = Math.random()+"""";" & vbCrLf &_
                                           "var a = axel * 10000000000000;" & vbCrLf &_
                                       "</script>" & vbCrLf &_
                                       "<noscript>" & vbCrLf &_
                                                blah blah
                                      "</noscript>" & vbCrLf
%>

<%if dir = "search" AND st = "overture" then %>
<!-- #include file = "inc/cpDisplay.asp" -->
<%end if%>

<%
Function WriteQS()
      if st <> "" then
            Response.write("st=" + st)
      elseif id <> "" then
            Response.write("id=" + id)
      else
            Response.write("id=0")
      end If
end Function

    SELECT CASE dir
      
        'November 07 DM urls

          CASE "29","29DM","29dm"
                  pricepoint = "29.99"
                  phone = "1-888-376-3435"
            CASE "39","39DM","39dm"
                  pricepoint = "39.99"
                  phone = "1-888-376-3435"
                        
        'January 07
            
            'Begin WV/VA variable
            CASE "broadbandspeed"
                pricepoint = "39.99"
                phone = "888-229-7359"
                version = "freedom"
                va = true
            
                SELECT CASE id
                      CASE 4,6,8,10,14,15,16,18,20,22
                            version = "veriations"
                      CASE 26,28,30,32,36,37,38,40,42,44,48,54,56,65,66,82,83
                            version = "veriations"
                            phone = "1-877-460-2DSL"
                END SELECT
            
            CASE "forbusiness", "gofast"
                pricepoint = "39.99"
                phone = "888-229-7359"
                version = "freedom"
                va = true
          'End WV/VA variable
            
            CASE "callanywhere", "businesstools", "businessinternet", "workonline", "businesssavings", "greatplan", "bundlesforbusiness", "businessconnections", "onlinesavings", "getonline", "businessplan", "getinternet", "officesavings", "bestchoice"
            pricepoint = "39.99"
            phone = "1-877-460-2DSL"
            version = "freedom"
            
      
        'November 06 urls
            CASE "bizdsldeal"
                pricepoint = "39.99"
                phone = "1-877-460-2DSL"
                version = "freedom"
            
                SELECT CASE id
                      CASE 0,01,04,06,08,10,12,13,14,17,19
                            pricepoint = "39.99"
                            version = "freedom"
                      CASE 02,03,05,07,09,11,18,20
                            pricepoint = "39.99"
                            version = "veriations"
                      CASE 15,20,21,22,23,24,25
                            pricepoint = "29.99"
                            version = "freedom"      
                      CASE 16
                            pricepoint = "29.99"
                            version = "veriations"            
                END SELECT            
            
            CASE "reliabledsl"
                pricepoint = "39.99"
                phone = "1-877-460-2DSL"
               
                SELECT CASE id
                      CASE 01,05,11
                            pricepoint = "29.99"
                            version = "freedom"
                      CASE 02,06,12
                            pricepoint = "29.99"
                            version = "veriations"
                      CASE 03,07,09,13,15
                            pricepoint = "39.99"
                            version = "freedom"      
                      CASE 04,08,10,14,16
                            pricepoint = "39.99"
                            version = "veriations"            
                END SELECT            
            
            CASE "yourbusiness"
                pricepoint = "39.99"
                phone = "1-877-460-2DSL"
            
                SELECT CASE id
                      CASE 01,04,06,21,23,26
                            pricepoint = "39.99"
                            version = "freedom"
                      CASE 03
                            pricepoint = "29.99"
                            version = "veriations"
                      CASE 02
                            pricepoint = "29.99"
                            version = "nobundle"      
                      CASE 05,07,17,24,27,29
                            pricepoint = "39.99"
                            version = "veriations"            
                END SELECT            
            Start Free Trial
 
Loading Advertisement...
 
[+][-]12.14.2007 at 02:55AM PST, ID: 20470847

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C# Programming Language, WebApplications
Tags: convert, asp, object, class, classic
Sign Up Now!
Solution Provided By: the_crazed
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628