Trang chủ Lập trình ASP.NET

Đăng nhập

Chưa là thành viên? Hãy đăng ký ngay, chỉ 30 giây. Sau khi đăng ký bạn có thể đăng bài viết tại phieubong lab để chia sẻ kiến thức của mình.



Thống kê

Số lần xem bài viết : 15298

Đang online

Hiện có 18 khách Trực tuyến

Quảng cáo


Free web hostingWeb hosting

 

Host PHP miễn phí 1.5GB,
Đăng ký ngay!! Free Website Hosting
Lập trình ASP.NET
Cách hiển thị đúng menu control trên trình duyệt Google Chrome - asp.net 2.0 PDF. In Email
Xem kết quả: / 2
Bình thườngTuyệt vời 
Web sưu tập - Lập trình ASP.NET
Viết bởi Administrator   
Thứ sáu, 05 Tháng 2 2010 15:28

Vấn đề là hiện nay có nhiều lập trình viên băn khoăn không biết vì sao Menu control trong asp.net 2.0 lại không thể hiển thị trên Chrome một cách đúng đắn như trên IE hay FF. Sau đây là giải pháp nếu bạn đang tìm kiếm cách giải quyết.

Để làm được bạn cần phải khai báo cho .net về tính năng của trình duyệt mà bạn muốn hiển thị. Từ .net 2.0 trở lên cần phải tạo 1 file browser mới và tải lên web server của  bạn.

Bước 1. Nhấn chuột phải trong VS 2008 Solution Explorer , rồi chọn "add the ASP.NET Folder" , chọn "App_Browsers " nếu chưa có folder này.

Bước 2. Tiếp đó, tại App_Browsers, nhấn chuột phải rồi nhấn " Add new item ", rồi chọn thêm file Browser, đặt  tên file là safari.browser  (tên là safari nhưng vẫn có tác dụng tốt đối với chrome).

Bước 3. Mở file safari.browser ra, và xóa hết nội dung có sẵn trong đó, rồi thêm vào những dòng sau đây: 

<browsers> 

  <browser refID=”safari1plus”> 

    <controlAdapters> 

      <adapter controlType=”System.Web.UI.WebControls.Menu” adapterType=”" /> 

    </controlAdapters> 

  </browser> 

</browsers> 

Bước 4. Lưu file và mở trang web localhost ra trên chrome để kiểm tra lại.

Bước 5. Upload thư mục "app_browsers" lên webserver của bạn.

Bước 6. Nếu có lỗi gì xảy ra trên server thì hãy xóa thư mục "vti_cnf" trong thư mục "app_browsers", nếu có upload lại lần nữa thì cũng phải xóa thư mục "vti_cnf" lại nhé. Thư mục "vti_cnf" chỉ xuất hiện khi bạn upload bằng frontpage hay sharepoint.

 

Phieubong Sưu tầm.

 
Cách giải quyết vấn đề về hiển thị Report bằng ReportViewer trên ứng dụng web chạy trên IIS7 PDF. In Email
Xem kết quả: / 2
Bình thườngTuyệt vời 
Web sưu tập - Lập trình ASP.NET
Viết bởi Administrator   
Thứ tư, 03 Tháng 6 2009 20:53

Friday, November 2, 2007

Solving ReportViewer Rendering Issue on IIS7

Applies to:

  • Internet Information Services 7.o (IIS7)
  • Microsoft Report Viewer Redistributable 2005
Symptoms:
  • Unable to render ReportViewer on ASP.NET Web pages while running on IIS7.
  • You have no problem viewing your reports when running on debug mode with your Visual Studio 2005.
  • You are able to view your reports on Report Manager but not able to view them on IIS7.
  • You encounter JavaScript error when loading your report page with ReportViewer. Image buttons such as calendar appear as red 'X'.

Cause:

  • When the ReportViewer control is added to Web Form (.aspx), the
    Reserved.ReportViewerWebControl.axd httpHandler is added to System.Web section of the Web.Config file. In IIS7, it should be added under System.Webserver section.
  • IIS7 Handler Mappings does not contain Reserved.ReportViewerWebControl.axd httpHandler, and therefore unable to render the ReportViewer elements needed by the JavaSript.

Resolution:

  • Open Internet Information Services (IIS) Manager and select your Web application.
  • Under IIS area, double-click on Handler Mappings icon.
  • At the Action pane on your right, click on Add Managed Handler.
  • At the Add Managed Handler dialog, enter the following:
    Request path: Reserved.ReportViewerWebControl.axd
    Type: Microsoft.Reporting.WebForms.HttpHandler
    Name: Reserved-ReportViewerWebControl-axd
  • Click OK.

Reserved-ReportViewerWebControl-axd handler is now added to your Handler Mappings list. Notice that the following line has also been added to your Web.config file under the system.webserver's handler section:

 


verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified"
/>

Run your report again.