2010/10/22

Aspx page, Frameset, and QueryString

I encountered a situation that I have to pass values through the query string to an aspx page which contains frameset settings. Here is what I found how to do it (and it works for me).

Let's say I have a Default.aspx which has a frameset settings, and it contains two frames link to Menu.aspx and Content.aspx. Here is the html code for the Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>

<!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>xxxx</title>
 </head>
 <frameset cols="20%,80%">
  <frame name="Menu" src=<%= GetMenuFrame()%> />
  <frame name="Content" src=<%= GetContentFrame()%> />
 </frameset>
</html>