|
thanks for your reply..
yes I think so, because if I give it a string literal:
e.g. <%Session("BufferValue") = "A string literal";%>
it works fine!
It gets used on a Form on another page, which, again, works fine if I give it the string but not the variable, as follows:
<FORM>
...other stuff
<input type=hidden name= FName value=<%=Session("BufferValue")%>>
</FORM>
Unfortunately though I can't give it a string.
thanks again for your help
code dope.
|
|
|
|
|
code dope wrote:
can't store an Intrinsic Object in a Session variable"
Looks pretty good to me but perhaps I'm still in the C++ mindset!
Any help would be appreciated - thanks.
You cannot use buffer as a variable name as it is an "intrinsic object" (whatever that means.) Check out Response.Buffer
So just change buffer to something else, like strBuffer etc.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
|
|
|
|
|
thanks , Paul.
In fact, I wasn't using "Buffer" as my variable name - I just used that here because the actual names are not meaningful unless you know what the project is all about, and, for various reasons, I am not allowed to make that public knowledge.
However, I will try using various names just in case I have stumbled across something that is "Intrinsic!!" (whatever that is!)
thanks again - I'll let you know what happens.
code dope.
|
|
|
|
|
No, it didn't work.
I tried this:
<%
var thingy;
thingy = Request.QueryString("A_Value")
Session("Batch")= thingy;
%>
and got this:
"An intrinsic object cannot be stored within the Session object."
By the way, the return from "Request.QueryString("A_Value")" is just a character string - actually it's a File name with nothing other than numbers and letters, so there shouldn't be a problem there.
any more ideas?
code dope.
|
|
|
|
|
Maybe this is an array? For example if you have several INPUTs with same name attribute? Try to use like Request.QueryString("value")(1) (dunno exactly how in Javascript, maybe it starts from 0?)
Well, just another thought
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
i love you forever & want to have your babies!!!!
only kidding!
IT WORKED! I changed the code to:
<%
strValue = Request.QueryString("A_Value")(1);
Session("Batch")= strValue;
%>
Seriously though, thanks a lot for your suggestion. And everyone else who had a go. I was really getting ****ed off with it. It looked as though the assignment to the Session variable was the culprit, when it was actually not getting the value from the Query String. Strange, though, because I use that line to get the value from the Query string in several other places and it never fails. Oh well, who cares!!!
Thanks again.
code dope.
|
|
|
|
|
Oh well, I'm glad it is working now
Wasn't sure because of differences between Javascript and VBScript (I'm using the last one to write ASP)
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
strOpen= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db10.mdb"
'cnn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db10.mdb"
Set rst = Server.CreateObject("ADODB.Recordset")
strSQL= "SELECT * FROM Students"
rst.Open strSQL,strOpen,adOpenKeyset ,adLockOptimistic
Response.Write rst.RecordCount & " "
/// I always get record count as -1
// Why cant I just use RecordCount property
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
look up the CursorType property in MSDN and set it appropriately before doing the open. here's a link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprocursortype.asp
jscript would be something like this:
rs = Server.CreateObject( "ADODB.Recordset" );
rs.CursorType = 1; // <--- set this correct
rs.Open( sCmd, con );
// then rs.RecordCount should work
|
|
|
|
|
adOpenKeyset
when i use this adOpenKeyset this is according to MSDN should allow me to count records. But OK I'll try using 1 instead adOpenKeyset
Thanks
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Right, but with client side cursor.:
rec.CursorLocation = adUseClient
and you don't have to use Keyset. The best way to boost performance is to use Client-side cursor (adUseClient ) with forward-only and read-only recordset (adOpenForwardOnly, adLockReadOnly )
and RecordCount works fine with such Recordset
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
It's a good plan to disconnect the recordset first, otherwise your page will have too much of a chatty relationship with the DB and your performance will be less than good.
Cheers,
Simon
X-5 452 rules.
|
|
|
|
|
Good reference, but couldn't open most of links
I tried Perl links for example
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
While I'm all for the free sharing of information, many of these ebooks are copies of books still on the market (and thus copyrighted).
I doubt Anonymous has received permission to place them online.
Not to be a party pooper, but I think Charles Petzold deserves every royalty check he's ever received for his Programming Windows books.
Let your conscious be your guide when visiting
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I wanna develop a web control which acts like Panel but has its special behavior. According to .net framework reference, ReadWriteControlDesigner allow drop child controls into the control.
But when perform a drop operation on my control with designer derives from ReadWriteControlDesigner, VS issue "The operation could not be completed".
What's going on? Is there any special method, event to be overided?
Any response should be appreciated.
|
|
|
|
|
I wanna assign a tool box bitmap to my own Web Server Control, and my source code just like following:
...
[
...
ToolboxBitmap(@"imagepath\image.bmp"),
...
]
public class mycontrol : WebControl
...
It does work at design time, that is the default "gear wheel" icon is replaced by the new image(but the background is not transparent).
When i run the app, system issues a "Unable find imagepath\image.bmp" error.
Can you help me to resolve this problem ?
Thanx.
|
|
|
|
|
1) name the bitmap with the same full ( namespace+classname ) name as the webcontrol
1a) i've heard that the bottom left hand cornor pixel is marked as the "transparent color" for the icon.
2) set the following attribute:
ToolboxBitmap( typeof( Bitmap ) )
this means that the toolbox icon will be embeded in the assembly as a bitmap with the same name as the control.
if you are in visual studio...
3) add the bitmap to the project
4) set the compile type to embeded resource
if not
3) add the following arg to the compile command line
/resource:"C:\path\to\my\bitmap.bmp"
now when you compile it... you should see it in the toolbox.
|
|
|
|
|
First, if either in Visual C# or Visual Basic, you should not have to name the bitmap in "namespace+classname" format, because once you add a image or other non-XML resource into the project,the computed manifest res name of the resouse would be "rootnamespace.xxxxxxx", in other words we don not need add namespace manually.
Second, and this is the most important, ToolboxBitmapAttribute will set the icon as file or assembly resource, although you mentioned assign a bitmap resource with the same assembly name as the control, the usage of "typeof(Bitmap)" is wrong, because the attribute need specify an assembly type or name where can find the icon. The type is the control itself, we already embed a bitmap with the same assembly name as it.
Now, I made it. Thank you inprised me. and the following is the steps in Visual Studio.Net.
- Create a WebControl Library project in VS.Net;
- Add a WebCustomControl as name you specified, for example "MyCtrl1";
- Add a 16*16 bitmap named "MyCtrl1.bmp" into the project, the name should be same as the classname of the control.
- Set Select "MyCtrl1.bmp" in Solution Explorer and set File Property "Build Action" to Embedded Resource;
- Modify the source code of the control like following:
namespace mylib
{
...
[
...
ToolboxBitmap(typeof(MyCtrl1)),
...
]
public class MyCtrl1 : WebControl ...
{
...
}
}
Then build the project.
Charles Chen
|
|
|
|
|
Ah,yes, it appears that the Type parameter was wrong...
Some Microsoft guy told me to use Bitmap...
I always do, and it still Works For Me©
As for the namespace... What you have there must only work for Visual Studio, because if you leave off the namespace, it won't work from the command line compiler. VStudio must set something special in there somewhere
|
|
|
|
|
Andy Smith wrote:
VStudio must set something special in there somewhere
VStudio pre-pends the default namespace to images set as 'embedded resource'. No such thing exists for the commandline so you have to prepend the image filename yourself.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
hi folks im trying to run my asp page on ebiz server that has web sphere as the application engine.do asp pages run on web sphere??
Luv
ParDS
Why Need Parking lots in Bars when Drunken Driving is Prohibited
|
|
|
|
|
hi,
i have some server control that generates images using GDI+ function, now i want to know if there is a way to indicates to client that the image has change and must reload it.
thanks in advance
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
Hi,
all
I have create a new asp.net web service ,and I put the whole solution in the /wwwroot/webserive.
In another window application, I use "add new web reference " to import the web service .I input "http://localhost/webservice/helloworld.asmx" in the
address line,and then the system display a dialog to prompt
me to download the helloworld.asmx file to my own local machine. So I want to know why? Could I only use the web service on the condition that I download it to my own machine?
Your advaced help will be appreciated!
Regards.
|
|
|
|
|
Literally, I'm losing it here!
Simply want to transform an xml document with an xsl stylesheet using the <asp:xml> control. The documents will be dynamic based on a provided parameter (querystring, form value, whatever) so I'm using the DocumentSource and TranformSource properties in my code-behind file to dynamically assign the xml and xsl documents.
I repeatedly get this error:
"Object reference not set to an instance of an object."
Now, I don't get the error if I use the DocumentSource and TransformSource attributes in the xml web control like this:
<asp:xml id="detailsXml" documentsource="file.xml" transformsource="file.xslt" runat="server"/>
Here is some code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.Xsl;
public class PFDetailsPage : System.Web.UI.Page
{
//xml web control
protected Xml detailsXml;
private void Page_Load(object sender, System.EventArgs e)
{
//xml and xsl files
string xmlFile = Server.MapPath("xdetails/details.xml");
string xslFile = Server.MapPath("xdetails/details.xslt");
//call transform method below
TransXmlFile(xmlFile, xslFile);
}
public void TransXmlFile(string xmlFile, string xslFile)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlFile);
detailsXml.Document = xmlDoc;
XslTransform xslDoc = new XslTransform();
xslDoc.Load(xslFile);
detailsXml.Transform = xslDoc;
}
}
I also tried just doing this but got the same exact error on the same lines of code:
private void Page_Load(object sender, System.EventArgs e)
{
string xmlFile = Server.MapPath("details.xml");
string xslFile = Server.MapPath("details.xslt");
detailsXml.DocumentSource = xmlFile;
detailsXml.TransformSource = xslFile;
}
I'm absolutely sure the files are there, as I said, I had no problem using static values in the web control itself, it's only when I try to provide it values manually in my code-behind class that I start getting errors.
Thanks ahead of time!!
-v
|
|
|
|
|
Do you set detailsXml to New somewhere?
|
|
|
|