Я пытаюсь создать страницу, похожую на iGoogle, в .net 3.5
Я написал код (в asp.net) для динамического добавления пользовательских контролов в 2 веб-зоны ..... довольно простые вещи ....
я хочу прямо сейчас узнать, как мне МАКСИМИЗИРОВАТЬ каждую веб-зону отдельно, так как если я нажму кнопку o в строке заголовка, она должна занять всю страницу, а затем при минимизации она вернется к своей оригинальнойсостояние. (вроде как то, что происходит в iGoogle)
Кроме того, если вы запустите код, который я вставляю, вы увидите, что при нажатии на кнопку button_click она создает новую веб-зону каждый раз .... и я до сих пор не могу понять, какчтобы изменить заголовок формы управления 'UNTITLED' ..
Я пойду и скажу, что я новичок, и полное объяснение вместе с реализуемым кодом будет ДЕЙСТВИТЕЛЬНО БОЛЬШИМ :) :) :) ...и я не хочу использовать предварительно упакованный stustuff, такой как динамический плагин панели инструментов, и тому подобное ....:)
Ниже приведен мой код .cs
public partial class Process_Flow_Dashboard_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//done nothing here as I am trying to get the funcionalities of the web part before implementing in the proper page.
//probably wrong so please correct me
}
//The basic idea is that once the page is complete, there will be a multiple check box list with a list of widgets.
//the ones which are checked will be added to the page in the zones.a very basic DASHBOARD so to say.
protected void btn1_Click(object sender, EventArgs e)
{
//Getting the usercontrol through my local path(placed it in the same folder, so file name was sufficient)
UserControl Test = (UserControl)LoadControl("Subtract.ascx");
Test.ID = "test";
GenericWebPart part1 = WebPartManager1.CreateWebPart(Test);//creating first webpart
UserControl Add = (UserControl)LoadControl("Test.ascx");//Adding second webcontrol
Add.ID = "Add";
GenericWebPart part2 = WebPartManager1.CreateWebPart(Add);
//LoadControls();
WebPartManager1.AddWebPart(part1, Zone1, 0);//adding to first webzone.
WebPartManager1.AddWebPart(part2, Zone2, 1);//adding to second webzone.
WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode;//so that i can move the webparts around from one zone to another.
part1.Title.Equals("Zone1");//trying to change the title of the webparts, not working:(
}
}
И это мойкод aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Process_Flow_Dashboard_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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<table id="webTable1" runat="server" width="100%">
<tr>
<td>
<asp:WebPartManager ID="WebPartManager1" runat="server" Personalization-Enabled="true">
</asp:WebPartManager>
<asp:EditorZone ID="EditorZone1" runat="server">
<ZoneTemplate>
<asp:AppearanceEditorPart ID="AppearanceEditorPart1" runat="server" />
</ZoneTemplate>
</asp:EditorZone>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btn1" runat="server" Text="Button" OnClick="btn1_Click" />
</td>
</tr>
<tr>
<td>
<asp:WebPartZone ID="Zone1" runat="server" Width="100%" DisplayTitle="Zone 1">
</asp:WebPartZone>
</td>
<td>
<asp:WebPartZone ID="Zone2" runat="server" Width="100%" Title="Zone 2">
</asp:WebPartZone>
</td>
</tr>
</table>
</form>
</body>
</html>