|
hey christian, thanks
yeah the same i ment, actually i need to do some sort of winforms functionality(such as openfiledialogue/save..) and to make this as a .dll and need to use it on asp.net yaar...
self confidence+hard work=SUCCESS
|
|
|
|
|
MS Lee wrote: i need to do some sort of winforms functionality(such as openfiledialogue/save..) and to make this as a .dll and need to use it on asp.net
It will not work.
|
|
|
|
|
is there any posibilities to get the same...
and could you please what kinda of win form sources could be use as a dll in asp.net?
self confidence+hard work=SUCCESS
|
|
|
|
|
hi all,
how can i display a HeaderText in a GridView Horizontaly ?
i know normaly it doesnt exist in .NET HeaderText Horizontaly but mabe a workaround with HTML or something.
i need it horizontaly cause vertical take a lot of space in my GridView and i dont have so much.
thanks in advanced
|
|
|
|
|
EBeylo wrote: i need it horizontaly cause vertical take a lot of space in my GridView and i dont have so much.
If this only the reason then you can just put the Gridview inside Div and use the Vertical Scroll of Div.
|
|
|
|
|
Thanks for replying, my GridView is in a Div with a Vertical Scroll,
but i think it looks better when the user doesnt need to Scroll a long moment to see all the GridView, and my Table have a lot of columns and the best way is (if their a way like this) to put the headers Horizontally then the user dont need to scroll a lot.
|
|
|
|
|
EBeylo wrote: my GridView is in a Div with a Vertical Scroll,
Yaa... I have already Guessed that ,you have already try it. But I don't think we have any other option.
Let me check, If I have found something I will surely update you !!!
|
|
|
|
|
ok thank you and i will be happy if you find something!
On the other hand, i am thinking if we can put an HTML code inside the (HeaderText:"")
Example: <asp:BoundField DataField="Name" HeaderText= <HTML Code <i>NAME</i> HTML>
and inside this HTML something like: do this Text Horizontaly. the Problem i am not very good in HTML and i am not sure if its exists something like that ( do Text Horizontaly) i know only we can change the Text to Bold like (<b></b>) or Italian like (<i></i>)...
??
|
|
|
|
|
Hi all,
I'm still fighting with getting multiple lines in a dynamic gridview. Searching around led me to think that if I can change the data during the rowcreated handler this just might work.
gv2.RowCreated += new GridViewRowEventHandler(gv2_RowCreated);
gv2.DataBind();
protected void gv2_RowCreated(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i < 5; i++)
{
e.Row.Cells[i].Text.Replace(Environment.NewLine, "<br />");
}
}
Whenever I run the debugger, the new event handler line adds the handler, but never runs through the block of code. I'd imagine that during the DataBind, the rows are being created, so why isn't the system seeing this event?
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
itmaster21 wrote: gv2.RowCreated += new GridViewRowEventHandler(gv2_RowCreated);
From where you are executing this ? If you want to execute Event handler of a runtime created controls, you need to add this event handler before Page_Load()
|
|
|
|
|
Ah, maybe that's why! It's actually in the block of code that is being called from within the Page_Load().
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
Well, after moving it to the Page_PreLoad the event fires but apparently replacing the element.newline with the " " didn't do the trick. Dang!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
modified on Wednesday, December 17, 2008 1:01 PM
|
|
|
|
|
Here's the code:
<pre>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Xml;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections;
public partial class Subpgs_Warehouse_ShippingCalendar : System.Web.UI.Page
{
public Dictionary<string, string> content1 = new Dictionary<string, string>();
protected void Page_Preload(object sender, EventArgs e)
{
Generate_Table();
}
protected void Page_Load(object sender, EventArgs e)
{
//Generate_Table();
}
protected void Generate_Table()
{
try
{
using (Stream input = File.OpenRead(Server.MapPath("~/Subpgs/Data/Shipping/Calendar.binary")))
{
BinaryFormatter bf = new BinaryFormatter();
content1 = (Dictionary<string, string>)bf.Deserialize(input);
}
}
catch
{
}
int date = 0;
switch (DateTime.Today.DayOfWeek.ToString())
{
case "Sunday":
date = -6;
break;
case "Monday":
date = -7;
break;
case "Tuesday":
date = -8;
break;
case "Wednesday":
date = -9;
break;
case "Thursday":
date = -10;
break;
case "Friday":
date = -11;
break;
case "Saturday":
date = -12;
break;
}
int datelist = date;
DataTable Table1 = new DataTable("last_week");
DataTable Table2 = new DataTable("this_week");
DataTable Table3 = new DataTable("next_week");
DataRow dr1 = Table1.NewRow();
for (int i = 0; i < 5; i++)
{
Table1.Columns.Add(DateTime.Today.AddDays(date).DayOfWeek.ToString() + " " + DateTime.Today.AddDays(date).ToShortDateString(), typeof(string));
try{
dr1[i] = content1[DateTime.Today.AddDays(date).ToShortDateString()];
}
catch{
dr1[i] = "No Data supplied";
}
date++;
}
date += 2;
Table1.Rows.Add(dr1);
DataRow dr2 = Table2.NewRow();
for (int i = 0; i < 5; i++)
{
Table2.Columns.Add(DateTime.Today.AddDays(date).DayOfWeek.ToString() + " " + DateTime.Today.AddDays(date).ToShortDateString(), typeof(string));
try{
dr2[i] = content1[DateTime.Today.AddDays(date).ToShortDateString()];
}
catch{
dr2[i] = "No data supplied";
}
date++;
}
date += 2;
Table2.Rows.Add(dr2);
DataRow dr3 = Table3.NewRow();
for (int i = 0; i < 5; i++)
{
Table3.Columns.Add(DateTime.Today.AddDays(date).DayOfWeek.ToString() + " " + DateTime.Today.AddDays(date).ToShortDateString(), typeof(string));
try{
dr3[i] = content1[DateTime.Today.AddDays(date).ToShortDateString()];
}
catch{
dr3[i] = "No data supplied";
}
date++;
}
Table3.Rows.Add(dr3);
GridView gv1 = new GridView();
gv1.Width = 600;
gv1.DataSource = Table1;
gv1.DataBind();
gv1.HeaderRow.Height = 50;
gv1.HeaderRow.BackColor = System.Drawing.Color.Black;
gv1.HeaderRow.ForeColor = System.Drawing.Color.White;
gv1.RowStyle.Height = 100;
GridView gv2 = new GridView();
gv2.Width = 780;
gv2.DataSource = Table2;
gv2.RowCreated += new GridViewRowEventHandler(gv2_RowCreated);
gv2.DataBind();
switch (DateTime.Today.DayOfWeek.ToString())
{
case "Monday":
gv2.Rows[0].Cells[0].BackColor = System.Drawing.Color.Aqua;
break;
case "Tuesday":
gv2.Rows[0].Cells[1].BackColor = System.Drawing.Color.Aqua;
break;
case "Wednesday":
gv2.Rows[0].Cells[2].BackColor = System.Drawing.Color.Aqua;
break;
case "Thursday":
gv2.Rows[0].Cells[3].BackColor = System.Drawing.Color.Aqua;
break;
case "Friday":
gv2.Rows[0].Cells[4].BackColor = System.Drawing.Color.Aqua;
break;
}
gv2.HeaderRow.Height = 50;
gv2.HeaderRow.BackColor = System.Drawing.Color.Black;
gv2.HeaderRow.ForeColor = System.Drawing.Color.White;
gv2.RowStyle.Height = 175;
GridView gv3 = new GridView();
gv3.Width = 600;
gv3.DataSource = Table3;
gv3.DataBind();
gv3.HeaderRow.Height = 50;
gv3.HeaderRow.BackColor = System.Drawing.Color.Black;
gv3.HeaderRow.ForeColor = System.Drawing.Color.White;
gv3.RowStyle.Height = 100;
Panel1.Controls.Add(gv1);
Panel1.Controls.Add(gv2);
Panel1.Controls.Add(gv3);
if (!Page.IsPostBack)
{
datelist += 7;
for (int i = 0; i < 10; i++)
{
lb1.Items.Add(DateTime.Today.AddDays(datelist).ToShortDateString());
if (i == 4)
{
datelist += 2;
}
datelist++;
}
try
{
input_txt.Text = content1[lb1.SelectedItem.ToString()];
submit1.Text = "Update " + lb1.SelectedItem.ToString();
}
catch
{
input_txt.Text = "";
}
}
}
protected void submit1_Click(object sender, EventArgs e)
{
content1.Remove(lb1.SelectedItem.ToString());
content1.Add(lb1.SelectedItem.ToString(), input_txt.Text);
using (Stream output = File.Create(Server.MapPath("~/Subpgs/Data/Shipping/Calendar.binary")))
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(output, content1);
}
Response.Redirect("~/Subpgs/Warehouse/ShippingCalendar.aspx");
}
protected void lb1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
input_txt.Text = content1[lb1.SelectedItem.ToString()];
submit1.Text = "Update " + lb1.SelectedItem.ToString();
}
catch
{
submit1.Text = "Update " + lb1.SelectedItem.ToString();
}
}
protected void gv2_RowCreated(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i < 5; i++)
{
e.Row.Cells[i].Text.Replace(Environment.NewLine, "<br />");
}
}
}
</pre>
and here's the aspx:
<pre>
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ShippingCalendar.aspx.cs" Inherits="Subpgs_Warehouse_ShippingCalendar" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<asp:Panel ID="Panel1" runat="server">
</asp:Panel><br />
<asp:Panel ID="Panel2" runat="server">
Select Date to change: <asp:DropDownList ID="lb1" runat="server"
AutoPostBack="True" onselectedindexchanged="lb1_SelectedIndexChanged" />
<br />
<asp:TextBox ID="input_txt" runat="server" TextMode="MultiLine" Height="75px" />
<br />
<br />
<asp:Button ID="submit1" runat="server" Text="Update Record"
onclick="submit1_Click" />
</asp:Panel>
</center>
</asp:Content>
</pre>
<pre></pre><pre></pre><pre></pre>
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
Why are you not using RowDataBound event?I think it'll fulfill you requirement.
Cheers!!
Brij
|
|
|
|
|
I tried that first but it gave me the same results.
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
can you share your piece of code? aspx and c# code.
Cheers!!
Brij
|
|
|
|
|
Brij wrote: Why are you not using RowDataBound event?I think it'll fulfill you requirement.
No Brij, I Think, his problem is something different.
He Needs add event handler before page_load.
|
|
|
|
|
Hey Dude
Adding a eventhandler with every row means he wants to execute some statements on every row addiotion.My answer was the same can be done using RowdataBound function with ease.
Cheers!!
Brij
|
|
|
|
|
Hey Guys, I got it working. It was actually a combination of both your responses. I did have to move everything to the Page_PreLoad() and also do a RowDataBound event handler instead of RowCreated. I also had to change the event handler to this after it dawned on me that I'm replacing but not specifying that's what I want to be in the text area!
e.Row.Cells[i].Text = e.Row.Cells[i].Text.Replace(Environment.NewLine, "<br />");
Thank's for taking the time to help me out!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
|
|
|
|
|
Nice to know our soluation helps you!!
|
|
|
|
|
I have made a web application project with some asp pages. Include this web application project's dll in a web site project as reference.
In web site project, I want to create instance of any asp page exist in web application project. And display asp page as object.
How i can do this.
Zia
|
|
|
|
|
ZiaMehdi wrote: I have made a web application project with some asp pages. Include this web application project's dll in a web site project as reference.
I am clear about this part.
ZiaMehdi wrote: I want to create instance of any asp page exist in web application project
But not this one . can you give me some more details on it ? That whats your requirments ?
Thanks in advance ~!!
|
|
|
|
|
can you be more specific to the scnario?
Cheers!!
Brij
|
|
|
|
|
I developed a project Webapplication1 with one asp page Webform1.aspx. As you know when webapplication projects compiled it makes a dll for whole application. Compiled dll resides in Bin folder of webapplication1 project.
I also developed a Web site project by the name of WebSite1. Include webapplication1's compiled dll reference in website1 project.
Now I want to show webform1.aspx from website1, while webform1.aspx exist in webapplication1 project. I have created the instance of webapplication1.webform1 in website1 project but unable to load or show the form.
|
|
|
|
|
Is there any limitation for number of Asynchronous threads that we can create using ASP.net with configuration: IIS6.0, win 2003 server, net2.0, webservice, app pools.
|
|
|
|