| Cacheing Business Objects |
|
 |
Index ‹ dotnet-framework-aspnet
|
- Previous
- 3
- Databinding a Multi Column List?I need to databind a record set from the database into a page.
The output I need is a textbox and a label for every item in the
resultset, but I don't want a long vertical list... instead I want a
table with 3 or 4 columns, with each cell holding a textbox and a
label.
So if I were to bind this to a datagrid, the default view would be a
tall and narrow grid, but what I want is more of a rectangular shape on
the form.
Anyone know if this type of thing is possible?
- 4
- Weblog applicationHi,
which blogging engine would you recommend? Of course, I could settle for a mature application like Movable Type, but I would prefer a system written entirely in C#/ASP.NET - if possible with complete source code in order to adapt it to my requirements.
Are there any ASP.NET blogging engines that have reached an advanced stage? Would .Text or dasBlog be a good choice?
And: When will the Weblog Starter Kit see the light? ;-)
Many thanks,
P.
- 4
- timer control in asp.net
HI,
I have a doubt .
I am developing an application that is conducting test for the candidates.
now my doubt is test duration is 30 min.i am displaying the questions
randomly it is working well.
now i need to check the duration i have to use timer control on the page.
how to use and how to caliculate the remaing time period how much time
left,etc.or any alternative plz specify
plz give me help.
Regards,
Krishna.
- 4
- Dynamically added LinkButton event handlingHi,
I have a strange issue occurring with LinkButtons that are dynamically added
to each (data) row of my DataGrid on that grid's ItemDataBound event. Each
LinkButton is assigned its own event handler to deal with the Command event,
but for some reason I can get this to work in a C# project but not in a newly
created VB.NET one.
The relevant VB.NET is as follows:
''' <summary>
''' Bind the columns within the grid to runtime data
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Sub MattersGrid_ItemDataBound(ByVal sender As Object,
ByVal e As DataGridItemEventArgs)
If (e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem OrElse e.Item.ItemType =
ListItemType.SelectedItem) Then
Dim l_link As New LinkButton
With l_link
.ID = "MatterSelectedButton"
.Text = DataBinder.Eval(e.Item.DataItem,
"Name").ToString()
If e.Item.ItemType = ListItemType.SelectedItem Then
.BackColor = System.Drawing.Color.LightYellow
Else
.CommandName = "ItemSelected"
.CommandArgument = e.Item.ItemIndex
AddHandler .Command, AddressOf MattersGrid_Command
End If
End With
' the 1th column is the templatecolumn in the grid
e.Item.Cells(2).Controls.Add(l_link)
End If
End Sub
''' <summary>
''' Handle click-commands performed on the grid (TODO; currently
misbehaving)
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Protected Sub MattersGrid_Command(ByVal sender As Object, ByVal e As
CommandEventArgs)
If (e.CommandName = "ItemSelected") Then
MattersGrid.SelectedIndex =
Integer.Parse(e.CommandArgument.ToString)
RebindDG()
End If
End Sub
and the similar, but working code in C# is:
/// <summary>
/// Bind the columns within the grid to runtime data
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TestDataGrid_ItemDataBound(object sender,
DataGridItemEventArgs e)
{
if (pr_debug) this.Page.Trace.Warn("TestDataGrid_ItemDataBound");
// only display the link on standard grid items (not
edit/select/header etc.)
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
LinkButton l_link = new LinkButton();
l_link.Text = DataBinder.Eval(e.Item.DataItem,
"ID").ToString();
l_link.CommandName = "ItemSelected";
l_link.CommandArgument = e.Item.ItemIndex.ToString();
l_link.Command += new
CommandEventHandler(TestDataGrid_Command);
// the 1th column is the templatecolumn in the grid
e.Item.Cells[1].Controls.Add(l_link);
}
}
/// <summary>
/// Handle click-commands performed on the grid
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TestDataGrid_Command(Object sender, CommandEventArgs e)
{
if (pr_debug) this.Page.Trace.Warn("TestDataGrid_Command");
if (e.CommandName == "ItemSelected")
{
TestDataGrid.SelectedIndex =
int.Parse(e.CommandArgument.ToString());
RebindDG();
}
}
I know there are a couple of subtle differences between the two, but the
core is essentially the same. However, the VB.NET one never fires the Command
event but the C# one does.
The DataGrid in both cases is also dynamically added to the parent control
(a Web Part) and is a 'global' protected object.
Any ideas?
Thanks,
Marc
- 4
- 5
- My own AX DLLHi all
I created my own ActiveX DLL
How do I use it in ASP.NET?
I know how to use it in ASP but not .NET :(
TIA
Guy
- 5
- Transmit File AND HTML in ResponseThe standard method to transmit a file from an aspx page to a browser
is to stream the file to the response then end the response. The HTML
code generated by the aspx page is discarded, and the browser displays
or offers to save the binary file instead.
I would like to have the browser accept and display the revised HTML
code as well as offering to open or save the attached file. This
SHOULD be possible using a multipart MIME format - one part is declared
with a Content-Disposition of inline and a Content-Type of text/html,
and a second part with a Content-Disposition of attachment and a
Content-Type of application/octet-stream.
However, I haven't been able to get a valid multipart response out of
my aspx page (using multipart/mixed or multipart/x-mixed-replace). The
Page wrapper seems to be hard-coded to creating and sending headers
that are incompatible with this approach.
Has anyone succesfully done something like this? My example code is
below, which is a simple page that displays a file and updates a view
count. When the page is refreshed, the view count increments. When a
file is displayed, the view count is incremented in code but the
revised HTML is not sent to the browser, so you don't see the textbox
change. Also, since the ViewState is not updated in the browser, the
view count goes back to it's previous state when you next refresh.
I've tried removing the Response.End() at the end of the ShowDocument
method, but bad things happen (the next button click generates a
bizarre page that has the html code displayed twice with a partial HTTP
header between them...). I also tried manually setting the
Response.ContentType to multipart/mixed and writing the boundary
between the HTML output and the file streaming, but I couldn't change
the ContentType after the inital headers had been sent.
Thanks for any ideas...
John H.
== WebForm1.aspx ==
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="ShowDocumentTest.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body >
<form id="Form1" method="post" runat="server">
<p><asp:TextBox id="TextBox1" runat="server"
Width="400px"></asp:TextBox></p>
<p><asp:LinkButton id="btnPDF" runat="server">Show
file</asp:LinkButton></p>
<p><asp:Button id="Button1" runat="server"
Text="Refresh"></asp:Button></p>
</form>
</body>
</html>
== WebForm1.aspx.cs ==
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace ShowDocumentTest
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton btnPDF;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
private int viewCount = 0;
private void Page_Load(object sender, System.EventArgs e)
{
if (IsPostBack)
viewCount = (int)(ViewState["viewCount"]);
viewCount++;
ViewState["viewCount"] = viewCount;
TextBox1.Text = "You've seen this " + viewCount + " times";
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnPDF.Click += new System.EventHandler(this.btnPDF_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnPDF_Click(object sender, System.EventArgs e)
{
ShowDocument(Request.MapPath("files") + Path.DirectorySeparatorChar
+ "example.pdf");
}
private void ShowDocument(string filePath)
{
FileInfo fi = new FileInfo(filePath);
string fileName = Path.GetFileName(filePath);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=\""
+ fileName + "\"");
Response.AddHeader("Content-Length", fi.Length.ToString());
byte[] buffer = new byte[1024];
long byteCount;
FileStream inStr = File.OpenRead(filePath);
while ((byteCount = inStr.Read(buffer, 0, buffer.Length)) > 0)
{
if(Response.IsClientConnected)
{
Response.OutputStream.Write(buffer, 0, (int)(byteCount));
Response.Flush();
}
else
break;
}
inStr.Close();
Response.End();
}
}
}
- 5
- UnicodeEncoding / Encryption RSAHi,
I am trying to display the encrypted value on the console. When I use
the following
UnicodeEncoding encoding = new UnicodeEncoding( );
string constructedString = encoding.GetString(encryptedData);
And I print constructedString on to the console, I see "??????" When I
do a debug, I see boxes. But if I put a watch on the variable (on the
encrypteddata), see the hex values.
What I want to do is display the hex value on the screen.
Any help would be greatly appreciated.
Thanks,
Shahid
- 5
- Windows Workflow Foundation on .NET 2.0?Is it possible to run Windows Workflow Foundation on .NET Framework
2.0? We do not want to go down the road of installing .NET 3.x
framework, at least not for the foreseeable future.
We want to use it with asp.net 2.0 (vb) applications.
Thanks.
- 10
- CheckBoxes in DataGrids-- the "checked" attribute not correct afteCheck if you have datagrid's viewstate enabled.
Check if you re-bind your data in postback. If you do, the selection info
will be lost.
--
Ting Huang
"Jim Bancroft" wrote:
>
> Hi everyone,
>
> I'm using a DataGrid with TemplateColumns. My DataGrid is located in a cell
> of an asp:Table. I did this so it's positioned correctly onscreen.
>
> One of the DataGrid's TemplateColumns is a checkbox. During the page's
> postback I loop over the DataGrid and read the checkbox values. My problem
> is, none of the checkboxes ever have their "Checked" attribute set-- it's as
> though anything I mark is ignored.
>
> If I put a checkbox outside of the DataGrid, into a separate cell of my
> table, I can read its Checked attribute correctly during postback. Is there
> something I'm missing here when it comes to placing checkboxes into DataGrid
> columns? I enabled the viewstate on my checkbox, but that didn't help. If
> you have any suggestions or tips, I'm all ears. Thanks!
>
>
>
- 10
- can't send mail in html formatHi,
I have this very annoying problem: I'm trying to send email in html format
through smtp but i always get it in text format.
here is the code:
MailMessage msgMail = new MailMessage();
msgMail.BodyFormat = MailFormat.Html;
msgMail.To = email***@***.com;
msgMail.From = email***@***.com;
msgMail.Subject = "Hi Chris, another mail";
string strBody = "<html><body><b>Hello World</b>" +
" <font color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(msgMail.From, msgMail.To, msgMail.Subject, msgMail.Body);
any ideas?
Regards,
Ofit Amitai
- 12
- Datagrid Edit DropdownList Help!I have been searching all the articles on a Datagrid DropdownList, and I
cannot seem to get it to work. Work, as in, I keep getting a
NullReferenceException, when I try and get the selected value from the
DropDownList in a Datagrid.
Code:
<asp:TemplateColumn HeaderText="System">
<EditItemTemplate>
<asp:DropDownList id="ddEditSystem" ROWS=4 CLASS='greyText' MULTIPLE
DataTextField="SysName" DataValueField="SystemID" DataSource='<%#
GetSystems() %>' SelectedIndex='<%# GetSelectedIndex(Container.DataItem
("ParkUserID")) %>' Runat=server/>
</EditItemTemplate>
</asp:TemplateColumn>
Source:
FUNCTION GetSystems() as DataSet
Dim DSEditSysData as New DataSet
Dim DBEditAdapt As SqlDataAdapter = New SqlDataAdapter
DBConn = New SQLConnection(ConfigurationSettings.AppSettings("MyDSN"))
DBCommand = New SqlCommand("SELECT SystemID, SysName FROM tblParkSystem
Order By SysName", DBConn)
DBEditAdapt.SelectCommand = DBCommand
DBEditAdapt.Fill(DSEditSysData, "SysName")
Return DSEditSysData
END FUNCTION
FUNCTION GetSelectedIndex(CID as String)
Dim iLoop as Integer
Dim ddlDataSet as DataSet = New DataSet
Dim dt as DataTable = ddlDataSet.Tables("tblParkUserSystem")
END FUNCTION
SUB UpdateLink_Click(sender As Object, e As DataGridCommandEventArgs)
*** LINE THAT DOES NOT WORK ****
END SUB
--
Message posted via http://www.dotnetmonster.com
- 13
- Lost InetlliSenseHow do I get back IntelliSense
Lost IntelliSense in all Languages etc..
already went to Tools-Options-Text Editor-All Languages-General and made
sure that
AutoListMembers is checked, tried Ctrl-space, CtrlPeriod no luck
Restarted computer and VS.Net etc..
where else to look
Thanks
- 15
- asp:label in asp:datalist - Setting Text Value Does not work!Hi,
Can anyone tell me why the below code does not work.
I dont get any errors, but nor does the Text for the asp:label get
set.
Thanks in advance as always
H
protected void Page_Load(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
if (Request.QueryString["Range"] == "Plat_Price"){
string PlatLabel = "Platino";
Label hypSelectC = (Label)e.Item.FindControl("hypSelectC");
hypSelectC.Text = "PlatLabel";
}
}
And in the html I have the following label, which is contained within
a Datalist.
<ASP:DataList ID="dlListCases"
RepeatColumns="2"
RepeatDirection="Horizontal"
RepeatLayout="Table" ItemStyle-CssClass="CaseRightBorder"
runat="server">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0"
class="CaseTable">
<tr>
<td colspan="2" class="CaseTableHeader"><%#
DataBinder.Eval(Container.DataItem, "CaseName") %>
</td>
</tr>
<tr>
<td width="75" valign="middle">
<asp:image runat="server" AlternateText="Thumbnail" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "image_thumb") %>'/>
<br>
</td>
<td width="134" valign="top"> <%#
DataBinder.Eval(Container.DataItem,
"Bullet_Points").ToString().Replace("\n","<br>") %>
<br>
<b>Price:
<%# DataBinder.Eval(Container.DataItem, "PriceCol", "{0:c}") %>
<asp:label CssClass="BoldLabel" ID="hypSelectC"
runat="server"></asp:label>
</b>
</td>
</tr>
</table>
</ItemTemplate>
</ASP:DataList>
- 15
|
| Author |
Message |
Thom Anderson

|
Posted: 2006-11-26 3:54:07 |
Top |
dotnet-framework-aspnet, Cacheing Business Objects
Hi, I have some business objects that are pretty simple. They get
instantiated and have a few properties, methods, and events. The business
objects talk to the database directly or access web services. But 99% of
the time when they are instantiated or initially used, they access a
database and receive a datatable.
Can someone show me how to do the following;
1) cache the business object in a way that it gets used by all of the users
to the web site. I would like to store it so that each subsequental user
does not cause the database to run the query again and I do not use up the
web server memory. Maybe after 5 minutes it can be emptyied from the cache?
2) cache the business object on a per user basis, so that once the users
session starts the object gets created and doesn't have to go back to the
server to run the query again. Unless maybe their session expires.
Does this make sense? You can talk back to me using a foo{} fake class
object. I will understand. I use 1.1 but will use 2.0 and maybe 3.0 next
year.
Thom
|
| |
|
| |
 |
John Timney (MVP)

|
Posted: 2006-11-27 5:35:00 |
Top |
dotnet-framework-aspnet >> Cacheing Business Objects
Theres a lot of articles about on SQLCachedependency, whihc should answer
msot of your questions for you very easily.
Try this one for a starter:
http://www.eggheadcafe.com/articles/20060407.asp
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Thom Anderson" <email***@***.com> wrote in message
news:u$email***@***.com...
> Hi, I have some business objects that are pretty simple. They get
> instantiated and have a few properties, methods, and events. The business
> objects talk to the database directly or access web services. But 99% of
> the time when they are instantiated or initially used, they access a
> database and receive a datatable.
>
> Can someone show me how to do the following;
> 1) cache the business object in a way that it gets used by all of the
> users to the web site. I would like to store it so that each subsequental
> user does not cause the database to run the query again and I do not use
> up the web server memory. Maybe after 5 minutes it can be emptyied from
> the cache?
> 2) cache the business object on a per user basis, so that once the users
> session starts the object gets created and doesn't have to go back to the
> server to run the query again. Unless maybe their session expires.
>
> Does this make sense? You can talk back to me using a foo{} fake class
> object. I will understand. I use 1.1 but will use 2.0 and maybe 3.0
> next year.
>
> Thom
>
|
| |
|
| |
 |
| |
 |
Index ‹ dotnet-framework-aspnet |
- Next
- 1
- Page is nullI'm converting a custom webcontrol from ASP.NET 1.1 to 2.0 to take advantage
of 2.0's new features, particularly using the WebResource handler to embed
Javascript includes and GIFs within the assembly instead of placing such
files in an aspnet_client sub-directory. The only problem I've found with the
conversion is that when I call :
this.Page.ClientScript.GetWebResourceUrl()
as a result of calling EnsureChildControls() in property get and set
methods, this.Page is null; I guess this is because the control hasn't been
inserted in the Page's controls collection.
Is there some way to force the control to add itself to the page so that I
can avoid this error?
I guess I could move the calls to this.Page.ClientScript.GetWebResourceUrl()
to the control's prerender method but I'd rather void this if possible.
Are there any good web resources on the differences/enhancements for
creating ASP.NET 2.0 custom web controls? I've looked at Nikhil Kothari's
blog. Any others worth checking out?
Any info/advice gratefully appreciated.
- 2
- 3
- Validate multiple PanelsI have a form that i've split up into multiple asp:panels, each panel
has a number of validators which work correctly.
At on the last panel, i want to commit the data collected to a
database. I figured since all the panel data is still being sent
through the postbacks, instead of using Sessions, or HttpContext, I
could just take the values from the textboxes.
This all works fine, except for security. I realized that I could
inject new values into the POST data. Once a page has been validated,
its not validated again before committing to the database, in essence,
making the validators on the other panels useless.
To fix this, before committing, I would get a list of all the
validators on the page, re-validate each, and if all of them were
still valid, commit. That way any injected POST variables would
become invalid and the commit would not happen. Code:
foreach (IValidator validator in Page.Validators)
{
validator.Validate();
if (!validator.IsValid)
return;
}
This gets a list of all the validators across all the panels, but
Validate() does not update the IsValid property and the injected
variables are allowed through. ... How come Validate() is not
updating? Testing, if I set a textbox.text = "" after it initally
validates, the textboxes custom validator which checks for length > 5
validates to true, even though it is not.
Any help would be greatly appreciated!
- 4
- Web service request does not reach IISI'm writing a Windows Forms application which gets data through a Web
Service. I'm trying to use the IIS HTTP 1.1 native compression. In
order to do that I've added the following methods to the proxy class
generated by Visual Studio:
protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest request = base.GetWebRequest(uri);
request.Headers.Add("Accept-Encoding", "gzip, deflate");
return request;
}
protected override WebResponse GetWebResponse(WebRequest request)
{
HttpWebResponseDecompressed response = new
HttpWebResponseDecompressed(request);
return response;
}
The HttpWebResponseDecompressed class receives the compressed response
and decompress it. This is what is happening: if I remove the second
line from the GetWebRequest method (which adds the header), all the 9
requisitions that I make on the program's initialization have answer.
But when the header is added, only the first 4 requisitions receive
answer (the answer is correctly compressed).
I've enabled the ASP.NET trace (which generates the trace.axd page) so
that I could see the requests received by IIS and the last 5 do not
appear. If I put a breakpoint in the GetWebRequest method, the
breakpoint is hit but they do not reach IIS.
Can anyone tell me what is happening or what can I do?
Thanks
- 5
- MDE Error "Not enough storage"Hello,
Recently I have not been able to open an asp.net page in MDE's web from
designer. I recieve the following error:
"The file failed to load in the web from designer. Please correct the
following error, then load again: Not enough storage is available to
complete this operation"
I have 54Gigs of free space and a gig of ram. Rebooting has not helped.
This is the GUI portion of a web project that is spilt into a DAL, BLL and
GUI that is in source safe.
I am runnint Micrsoft Development Environment 2002 Verison 7.0.9466
Micrsoft .NET framework 1.0 Version 1.0.3705
SysInfo With Visual Studio and the project open:
Total Physical Memory 1,024.00 MB
Available Physical Memory 543.21 MB
Total Virtual Memory 4.90 GB
Available Virtual Memory 3.97 GB
Page File Space 3.90 GB
Sys Info After trying to open Web Form Designer:
Total Physical Memory 1,024.00 MB
Available Physical Memory 89.13 MB
Total Virtual Memory 4.90 GB
Available Virtual Memory 2.97 GB
Page File Space 3.90 GB
Any suggestions would be appricated.
Thanks for your time,
Mark
- 6
- Using Session from a Windows App through a WebServiceI found the solution.
What I did wrong was to create a new CookieContainer for each call to
the webservice.
Instead I have create a private variable to hold the CookieContainer
and then only set this variable if its value is null.
i.e.:
private CookieContainer thisCookie;
private void button1_Click(object sender, System.EventArgs e)
{
StatusWS.GetStatus objWS = new StatusWS.GetStatus();
if ( thisCookie == null )
{
thisCookie = new CookieContainer();
}
objWS.CookieContainer = thisCookie;
textBox1.Text = objWS.GetStatusSession( "", "" );
}
Rgds.,
Per Loevgren
- 7
- Custom Control - Collection PropertyHey gang. I am taking the task of trying to learn how to write custom web
controls.
I have started with inheriting from the VS 2005 default which is UserControl.
I am implementing collection and just basic properties in my control and
they are compiling and running so far but when I try and view the page in the
designer I get such things like:
Error Creating Control
Type 'System.Web.UI.UserControl' does not have a public property named Columns
But when I run the page everything is okay. Could someone please describe to
me why this is occuring?
Also most examples I see using Collections uses Control or WebControl. Is
there any disadvantage to using UserControl and does this cripple my use of
properties in any way? I like the design-time support for the UserControl.
Any help would be greatly appreciated.
Thanks and take care.
- 8
- asp.net and chaning betten http and httpsI am just about to start work on the ecommerce section of our site and need
some advise please
Currently people are able to create a login to the site and they have lots
of functionality that they can use.
NOw there is a sectoin we are adding in which registered members can
purchase items from the site.
the question is... i have session values that we use in the site for various
things, but is ASP.NET similar to asp in the way that when you change from
http to https you lose all session vars?
Is ther anything i need to consider when trying to keep my sessio vars when
switching between http and https
- 9
- Repeater : AlternateItems when no AlternateItems are defined.I discovered by accident, that ItemCreated sees
ListItemType.AlternatingItems even when no alternate items are defined.
I thought, that this method would just receive all the EventArgs as as
normal ListItemType.Item,since I did not defined AlternateItemTemplates
in my repeater.
Funny, isn't it ?
- 10
- Source Safe doesn't store Image and HTML??I am using Visual Source Safe 6.0d, and I created a project then added it to
Source Safe using Visual Studio 2003 by right-clicking on the project.
When I login to Source Safe, I only see the .cs .aspx files, but not HTML or
JPG files, how do I include them in Source Safe? the reason is, JPG can
have multiple versions too! How to setup in Visual Studio 2003 so that the
whole project is uploaded to Source Safe?
help...
- 11
- group datasetI want to group my data being returned from my dataset, the dataset looks
like this:
<bmw></bmw>
<Lexus></Lexus>
<ChevyTahoe></Chevy>
<Mercedes></Mercedes>
<ToyotaFourRunner></Toyota>
If I get bmw, Lexus, or Mercedes returned i want to group them as 'Luxury'
and show them in my grid as that, If I get ChevyTahoe or ToyotaFourRunner
returned want to show them as 'SUV' and so on. how can I accomplish this? Is
this possible to do?
- 12
- Control of SmartNavigation?I have a page with three panels, Step1, Step2, Step3. Step1 is very large,
so I want SmartNavigation on. When user proceeds to Step2, I want it turned
off. However, two round trips are required, so SmartNavigation does not get
turned off until Step3! Any way to make this work?
ASPX:
<asp:panel id=pnlStep1 ...>
<asp:button id=btnNext1 text="Next"></asp:button>
</asp:panel>
<asp:panel id=pnlStep2 ...>
<asp:button id=btnNext2 text="Next"></asp:button>
</asp:panel>
<asp:panel id=pnlStep3 ...>
<asp:button id=btnNext3 text="Next"></asp:button>
</asp:panel>
C# CodeBehind:
// in page load, (!IsPostBack), Page.SmartNavigation is initially set on.
protected void btnNext1_Clicked(o,e)
{
Page.SmartNavigation = false; // does not take effect on this round trip!
pnlStep1.Visible = false;
pnlStep2.Visible = true;
}
protected void btnNext2_Clicked(o,e)
{
pnlStep2.Visible = false;
pnlStep3.Visible = true;
}
// Only on a subsequent round trip, for example to display pnlStep3, does
SmartNavigation go off.
So what is the deal with SmartNavigation? Is it one of those things that is
determined on InitComponent, before subsequent events fire, or is it
something we are supposed to be able to control?
Any help would be appreciated.
Haile
- 13
- HeaderStyle - How to align differently then rest of girdI am creating a datagrid. I need for the header to align closer to the
bottom of the grid row then then the rest of the data in the grid. I have
tried using HeaderStyle and putting a style of padding-bottom, setting it to
a negative number, but that doesn't seem to have an affect on the look. The
padding for the grid itself is 4px, but I need the header to have NO padding.
Any ideas?
Here is the code (keep in mind it is using style sheets where I am changing
the padding-bottom to no avail!):
<asp:DataGrid Width="100%" id="companyGrid" runat="server"
AutoGenerateColumns="False" CssClass="reporttype highlight" GridLines="None"
style="MARGIN-BOTTOM: 0px">
<AlternatingItemStyle CssClass="greyBkg"></AlternatingItemStyle>
<HeaderStyle CssClass="reporttypeheader"></HeaderStyle>
<Columns>
<cc:RowSelectorColumn HeaderText="COMPANY NAME" SelectionMode="Single">
<ItemStyle Width="40px" CssClass="leftcolumn"></ItemStyle>
</cc:RowSelectorColumn>
<asp:BoundColumn DataField="CompanyName"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="CompanyGUID"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
- 14
- Framwork 1.1->2.0: PostBack error when client script is applieHowdy Bjorn
Paste entire code for the aspx page.
Regards
--
Milosz Skalecki
MCAD
"Bjorn Sagbakken" wrote:
> Thanks Milosz,
>
> That was a great tip!
> Now, one thing I forgot to say is that I used VBScript for the client
> scripting. Because I'm only familiar with VB, and because this
> web-application is only used in my companys intranet, I wanted a quick
> solution. Well, now I understand that each page only can have one
> script-language at the time, so my suspision goes to a mix of vbscript and
> javascript.
>
> Anyhow, I have taken the first step in writing my first javascript, since
> this obviously is a general good idea. After some back and forth I'm
> actually very close to obtain my target. The errors are gone, and I have
> manged to trap the enter-key. Next, I want to code-wise click a button (that
> is; to perform the click-method for this button)
>
> The troubled code-line looks like this:
>
> document.getElementById("cmdSearch").click
>
> There is no error on this, a postback happens, but the desired search is not
> executed.
> I have no idea why. If I use the mouse and click on the "cmdSearch"-button
> the search is ok.
> Any idea? Is the code correct for "clicking the search-button from a
> script"? I have tried with "()" and ";" at the end, but this causes an
> error.
>
> Bjorn
>
> "Milosz Skalecki" <email***@***.com> wrote in message
> news:email***@***.com...
> > Hi Bjorn,
> >
> > Let me (briefly) explain how it works:
> >
> > Aspx pages generate html code (including your javascript) which is sent to
> > browser (you can see generated html document selecting 'view source' in
> > any
> > browser). Error you're seeing is definitely caused by javascript you
> > created
> > to detect enter key has been pressed. As you may know, after document is
> > retrived, browser parses its content and builds DOM objects in order to
> > provide dynamic functionality (i.e. message/prompt/confirmation box,
> > dynamic
> > text, etc.). Usually all scripts are concatenated to one (simplifiyng
> > shortcut:), therefore line numbers represent lines in parsed, concatenated
> > script. But don't worry, it's easy to debug client scripts in IE and
> > VS2005,
> > what you have to do is:
> > 1. IE->Tools->Internet Options, select advanced tab, untick 'Disable
> > Client
> > Script Debuging (Internet Explorer).
> > 2. Close all IE windows.
> > 3. Run asp.net application in debug mode and go to page that causes the
> > error,
> > 4. In VS2005, go to Debug->Window->Script Expolorer
> > 5. You should see list of all running documents
> > 6. Double click on the page that causes the error (on the list of course)
> > 7. put a breakpoint at the first line of your script
> > 8. You're done, you are able to debug your script.
> >
> > If it doesn't help, show us the script so we could provide a solution.
> >
> > Hope this helps
> >
> > "Error Line: 1, Char 2, Error: Invalid charcter, Code 0"
> > --
> > Milosz Skalecki
> > MCAD
> >
> >
> > "Bjorn Sagbakken" wrote:
> >
> >> Hello
> >>
> >> I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to
> >> 2.0
> >> I am at the end of debugging and fixing stuff. Now there is one error I
> >> just
> >> cannot find a solution to:
> >>
> >> On some pages I have applied a small client-script to trap the enter-key
> >> beeing pressed and re-route this action. With the new version this little
> >> script still works, it traps the enter-key. BUT it causes postback-errors
> >> on
> >> many other .NET control, dropdown lists, checkboxes. Tthe postback from
> >> these controls generates a browser error, claiming error with this (Line:
> >> 1,
> >> Char 2, Error: Invalid charcter, Code 0)
> >>
> >> First of all; What line no 1 is the line in question? Is it the code file
> >> in
> >> VS? No. Is it the html-file in VS? No. My best guess have been to click
> >> "view source" to sse what this page actually looks like from the browser
> >> point of view. The first line is a blank line, the second starts with
> >> "<!DOCTYPE HTML PUBLIC....." and I even tried to remove the "!" - in
> >> addition to many other more or less blind try and failure. When I disable
> >> the client script, the postback is ok again. Had it not been for the
> >> script
> >> actually working I would surely suspected the script itself.
> >>
> >> The strange thing is that this worked well in the previous version (VS
> >> 2003), no change of code when the upgrade to VS 2005 was done. I suppose
> >> I
> >> need to add some code lines somewhere, but I am getting exhausted by
> >> trying
> >> all thinkable combination.
> >>
> >> (I must add, I am not an expert at all, so maybe the obvious is staring
> >> wild
> >> and hard at me, laughing and grinning at its best)
> >>
> >> Regards
> >> Bjorn
> >>
> >>
> >>
>
>
>
- 15
- sessionDo you have enableSessionState set to false?
Regards,
Augustin
"drabee" <email***@***.com> wrote in message
news:email***@***.com...
> Dear All
>
> I have this command in ASP.NET 2.0
> session("test")="hello"
>
> I'm trying to retrive the seesion vale for onather web form using this
> command
> Dim a as string=ctype(Session.item("test"),string)
> But always giving me empty value .NO error message
> I tried also
> Dim a as string=session("test") but same problem
>
> Please can anyone help
>
>
|
|
|