|
And? Just extract the list again as shown in the demo code ..
If you want to store it in the session then change view state for session!?
Not rocket science.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Hi All,
My web application is having the path C:\Inetpub\wwwroot\Gospel and the admin part is in C:\Inetpub\wwwroot\Gospel\Admin,i have run the admin paart successfully.After finishing it ,i started developing the end user part which comes directly under C:\Inetpub\wwwroot\Gospel.The web.config file is in C:\Inetpub\wwwroot\Gospel\admin now and when im trying to run the project C:\Inetpub\wwwroot\Gospel it gives an error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." Before adding end user part to the project this error was not coming.Can anyone help me out in this .
Thanks in advance
|
|
|
|
|
I always avoid createing my Virtual directories inside Inetpub folder.
Go to your C:\ and Create a Folder "Gospel". Go to your IIS and Add a new Virtual Directory from there and point to the Gospel Folder in your C:\. That is how you should create a Virtual Directory. if you did not do this when you created your VD then it was not a Correct way
hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi all;
i'm new with the crystal report tech
plz told me
how can i Pass parameters into a Crystal Report from asp.NET page using c#
and how can i print this report by code
Kareem Elhosseny
|
|
|
|
|
|
I am creating a Custom Server Control, where one of the properties should be the data type of another property
for example:
for an instance x of my control, I need the user of my control to be able to write something like:
x.property1 = "abc";
x.property1Type = System.String;
So, how to define property1Type within the class
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Best way to do it using Generic in C#
|
|
|
|
|
I am familiar with Generic
BUT, I can not create a custome control from a generic class (I think)
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Mohammed Gouda wrote: BUT, I can not create a custome control from a generic class (I think)
why ? you can create separate class and create object of that class and pass the value and data type.
|
|
|
|
|
Abhijit Jana wrote: why ?
Creating generic control classes won't get designer support as designer don't know which type to be specified. If there is no designer support required, I believe it is possible.
|
|
|
|
|
AFAIK, you can't use generics here as you won't be able to view this control in the designer if you have a generic type with your class declaration. But you could do something like this
class YourClass
{
public Type Property1Type { get; set; }
object property1;
public object Property1
{
get { return property1; }
set
{
if (value.GetType() == this.Property1Type)
property1 = value;
else
throw new Exception("Invalid type");
}
}
}
YourClass a = new YourClass();
a.Property1Type = typeof(System.String);
a.Property1 = "Hello"; Above code allows to set only the specified type to "Property1". I am not sure this is the correct approach though. If you could tell me why you need this, there may be better ways to do this.
If you don't want designer support for this control you can use generic parameter with the class declaration. Then the code will be pretty nice.
class YourClassInGenerics<Property1Type>
{
public Property1Type Property1 { get; set; }
}
YourClassInGenerics<string> yourClass = new YourClassInGenerics<string>();
yourClass.Property1 = "Hello";
|
|
|
|
|
Thanks for Correcting Me !!!
|
|
|
|
|
You are welcome
|
|
|
|
|
did you check my recent article ?
|
|
|
|
|
Thanks for good effort
N a v a n e e t h wrote: If you could tell me why you need this, there may be better ways to do this.
Exactly, I want to bind business objects to TreeView which does not support this sort of binding. So, I created my own datasource which is supposed to support a variety of business objects
I got a safe solution
Instead of Generic or unknown datatype. I created an abstract class from which I inherited all other classes of which objects may be bound to my new datasource
It works well
N a v a n e e t h wrote: If you don't want designer support for this control you can use generic parameter with the class declaration. Then the code will be pretty nice.
Yes, I need a designer support
However, Thanks N a v a n e e t h for your great help.
You are one of the best of CP
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Mohammed Gouda wrote: I created an abstract class from which I inherited all other classes of which objects may be bound to my new datasource
Good.
Is this abstract class has some default functionality ? or it is just acting as a base class ? If it is acting as a base class, you should consider moving to an interface.
Controls like GridView/Repeater supports data binding objects which has IEnumerable implemented. Your control also could do something similar.
Mohammed Gouda wrote: You are one of the best of CP
Thanks. I am delighted
|
|
|
|
|
N a v a n e e t h wrote: Controls like GridView/Repeater supports data binding objects which has IEnumerable implemented. Your control also could do something similar.
Yes, My class alreay implement IHierarchicalEnumerable cause I deal with TreeView control.
Thanks for the hint
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Thanks to all participants
I got a safe solution
Instead of Generic or unknown datatype. I created an abstract class from which I inherited all other classes of which objects may be bound to my new datasource
It works well
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Hi All,
I'm using Ajax UpdatePanel in my page. I have two div controls inside UP and want to resize the div as per the size of image/ASPTable. When I check the size of image/table, it shows 0.
modified on Sunday, August 24, 2008 7:15 AM
|
|
|
|
|
Can you provide the code'It'll be better to answer.
Cheers!!
Brij
|
|
|
|
|
hello
i can not convert
ReDim Preserve data(totalBytesRead + dataBlock)
to C#
|
|
|
|
|
Use the Array.Resize method.
Note that neither ReDim Preserve nor Array.Resize actually does resize the array. A new array is allocated, and the data is copied from the original array. If possible, you should allocate a sufficiently large array from the stast.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hello
i used from Array.Resize,but i could not arrange its arguments
please help me that how can i arrange its arguments?
thanks
public byte[] ExtractBytesFromStream(Stream stream, int dataBlock)
{
int totalBytesRead = 0;
byte[] data;
try
{
while (true)
{
Array.Reverse(data, totalBytesRead, dataBlock);?
Array.Resize(data, totalBytesRead + dataBlock);?
int bytesRead = stream.Read(data, totalBytesRead, dataBlock);
if (bytesRead == 0)
{
break; // TODO: might not be correct. Was : Exit While
}
totalBytesRead += bytesRead;
}
Array.Reverse(data, -1, totalBytesRead);
return data;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
}
|
|
|
|
|
First of all, you don't even have an array at all. You have to create an array before you can resize it.
Why are you reversing the data in the array? If there is a reason to revere any data in the array, you can't reverse data that isn't even in the array yet, and there is no reason to reverse a bunch of zeroes. Also, you can't use -1 as starting index when reversing a part of an array.
You have to resize the array to the size of the actual data read before you return the array. Now you are returning an array that is larger than the actual data read, and you don't return how much of the array that contains valid data.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi all,
i m working on the email validation i ve to check email id either it is correct or not but i cannt send mail on them. ie when i validate all email id client send newsletter and they should not bounce.
thanx in advance
|
|
|
|