|
If all you want it redirect on timeout based on certain condition, why bother with cookies. You can write the javascript code conditionally from code behind. Look at ClientScriptManager[^] class.
|
|
|
|
|
The project is completed, it runs on local host without error.
I have written all my code based on working with this cookie. I can't change the whole now. Is there any way I can fix it with cookie?
Thanks,
|
|
|
|
|
Can you please explain more?
Thanks,
|
|
|
|
|
Hi All,
iam trying to develop a Web Server program. I wrote Server program in C# using sockets which listens to the clients. Iam trying to connect to the server through .aspx page using HttpWebRequest. If i click on send button in the web page, it is not showing the data, what i sent.
Observation: When i insert breakpoints in the server code and try to execute, it is displaying data..
Server code is like this..
class server
{
public static void main(string[] args)
{
int recv = 0;
string str;
byte[] data = new byte[1024];
IPAddress ip = IPAddress.Parse("10.18.90.110");
IPEndPoint iep = new IPEndPoint(ip, 11000);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(iep);
socket.Listen(5);
Console.WriteLine("Waiting for a client..");
while (true)
{
Socket client = socket.Accept();
int recv = client .Receive(data);
string strData = Encoding.ASCII.GetString(data,0,recv);
Console.WriteLine(strData);
}
}
}
Client program..
Button_Click event
string data = "test web server";
Uri uri = new Uri("http://10.18.90.110:11000");
HttpWebRequest request = (HttpWebRequest)WebRequest.create(uri);
StreamWrite sw = new StreamWriter(request.GetRequestStream());
sw.write(data);
sw.close();
|
|
|
|
|
Under Tools, options, Project Solutions, General, there is a check box for "Prompt for symbolic renaming when renaming files". What does this do? Does it simply rename a control (e.g. button, textbox) for every instance I happen to reference the renamed control? What should happen when renaming a class file?
Thanks,
|
|
|
|
|
When starting a new project, is it recommended to store the sln and suo file within the same directory as the rest of the aspx, and cs files, or should we keep the default path under C:\Documents and Settings\<name>\My Documents\Visual Studio 2008\Projects\<websitename>?
What are the advantages/disadvantages of having the suo and sln in a different directory than the project? The reason I ask is, I'd like to transfer my whole project on a usb drive or zip, from work to home machine each night. It's hard to open all of the associated files for the solution when I go home, b/c it cannot find the sln.
Thank you
|
|
|
|
|
Well, knowing what each file does will help you make your decision.
suo: is local visual studio solution info file. It retains information as to which files are open, which project is active, windows size and location etc. You can safely delete this file and loose nothing in terms of your actual code.
sln: file is your solution file. personally I like to this hierarchy
\development\solution\project.
I stick sln in the \solution folder and my projects in the \project folder.
you are free to follow ms recommendation or come up with your own.
|
|
|
|
|
Hiall .. I have an Exception that appears sometimes in my Asp.net website. So if anyone have any idea in how can I fix this Exception please help me and I’ll be very thankful...
This is the error:
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
I’m using .Net 2005 and SQL Express Edition.
Thank u all =D
|
|
|
|
|
adigatm wrote: please help me
Why? Is the error not descriptive enough or Google [^] not working where you live?
|
|
|
|
|
adigatm wrote: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached
Errors Clearly says about the problem is related with connection pooling. What is your max pool size ? Did you handled the connection open and closed properly ?
|
|
|
|
|
Thanks for your reply.
The max pool size is 100 and I’m using the dataset wizard not coding and in the wizard I don't know if there any way to close the connection or it is closed by itself.
And the problem that is the exception is suddenly appear while the site is running.
So If you have any idea about this pleases help.
|
|
|
|
|
I want to create my own Users / admin tables with various information, and most to all articles, including both asp.net books I read all revolve around MSSQL Web Site Administration Tool, which for some reason or another I find to restrictive for my purposes.
I want to know pretty much, based on I have a registration script working, how to make a login which uses my own tables in my database. My login stored procedure compares a username and a hashed password and returns a count, 0 being obviously an inexistent or invalid combination.
So how would I go about making a login script and creating a session? If you choose to post snippets of code, VB.NET and C# is what I am capable of understanding, I'm using VS2008 and MSSQL 2005.
Just for a side question, none of the articles where all to helpful or descriptive on restricting sections of a website (or in my case, whole directories) to certain usergroups. Any detailed explanation or even pointing me to a website would be great. I don't want full code, and this is absolutely not urgent, I'm capable of waiting for an answer as there are other things to be done while waiting on this. If you took a look at all this, thanks in advance. I tried to be as descriptive as possible.
|
|
|
|
|
We all use Scheduled Tasks in Windows OS.
How to create Scheduled Tasks in dotnet code???
do u have any samples???
help me...
Thanks,
nkmkrishna.
|
|
|
|
|
nkmkrishna wrote: do u have any samples???
Yes in fact there is one on CodeProject click here[^]
nkmkrishna wrote: help me...
I doubt that is possible
|
|
|
|
|
Lets start here. I have the following two classes:
public class Order
{
public Int32 Id { get; set; }
public String OrderNumber { get; set; }
public DateTime OrderDate { get; set; }
public String OrderStatus { get; set; }
public Int32 CustomerId { get; set; }
public List<OrderItem> Items { get; set; }
public Decimal Total { get; set; }
}
public class OrderItem
{
public Int32 OrderId { get; set; }
public Int32 OrderLineNumber { get; set; }
public Int32 ItemId { get; set; }
public Double OrderQty { get; set; }
public Decimal Price { get; set; }
public Decimal LineTotal { get; set; }
}
Here is some LINQ query that am using to fetch Orders from two database tables (OrderMaster and OrderDetail) and return a List<Order>. The LINQ DataContext that has the two tables is named TempContext.
static List<Order> GetOrders()
{
using (var context = new TempContext())
{
return (from om in context.OrderMasters
select new Order
{
Id = om.OrderID,
OrderNumber = om.OrderNumber,
OrderDate = om.OrderDate,
OrderStatus = om.OrderStatus,
CustomerId = om.CustomerID,
Total = om.Total,
Items = (from od in context.OrderDetails.Where(d => d.OrderID == om.OrderID)
select new OrderItem
{
OrderLineNumber = od.OrderLineNumber,
OrderId = od.OrderID,
ItemId = od.ItemID,
OrderQty = od.OrderQty,
Price = od.Price,
LineTotal = od.Total
}).ToList()
}).ToList();
}
}
My idea is to convert this LINQ Query to a Compiled LINQ Query and see whether I will be able to get any notable improvements on execution performance. Here is what I was able to do:
static List<Order> GetCompiledOrders()
{
using (var context = new TempContext())
{
return (from om in CompiledOrders(context)
select new Order
{
Id = om.OrderID,
OrderNumber = om.OrderNumber,
OrderDate = om.OrderDate,
OrderStatus = om.OrderStatus,
CustomerId = om.CustomerID,
Total = om.Total,
Items = (from od in CompiledItems(context, om.OrderID)
select new OrderItem
{
OrderLineNumber = od.OrderLineNumber,
OrderId = od.OrderID,
OrderQty = od.OrderQty,
ItemId = od.ItemID,
Price = od.Price,
LineTotal = od.Total
}).ToList()
}).ToList();
}
}
public static readonly Func<TempContext, IQueryable<OrderMaster>>
CompiledOrders =
CompiledQuery.Compile<TempContext, IQueryable<OrderMaster>>
((context)
=>
from om in context.OrderMasters
select om
);
public static readonly Func<TempContext, Int32, IQueryable<OrderDetail>>
CompiledItems =
CompiledQuery.Compile<TempContext, Int32, IQueryable<OrderDetail>>
((context, orderId)
=>
from od in context.OrderDetails
select od
);
The above code worked. Notice that I did two compiled queries. One to get me the Orders and the other to get me the OrderItems which I then combined in GetCompiledOrders method. I would like to know how else I can do this query so that I can use one compiled query and still have OrderItems [Items] as List<OrderItem> (not IQueryable<OrderItem> ) and still have GetCompiledOrders return List<Order>.
And yes, I googled. Most examples on how to create compiled queries cover returning a simple list (with no child collection). And yes, its possible that the NESTED LINQ way is the PROBABLY the best bet when it comes to these scenarios. Your thoughts are welcome. Thanks for your time. (And sorry for the long post).
Below is a script you can use to create OrderMaster and OrderDetail table.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderMaster](
[OrderID] [int] IDENTITY(1,1) NOT NULL,
[OrderNumber] [nvarchar](10) NOT NULL,
[OrderDate] [datetime] NOT NULL,
[CustomerID] [int] NOT NULL,
[OrderStatus] [nvarchar](36) NOT NULL,
[Total] [money] NOT NULL,
CONSTRAINT [PK__OrderMaster] PRIMARY KEY CLUSTERED
(
[OrderID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderMaster] ADD CONSTRAINT [DF_OrderMaster_Total] DEFAULT ((0.0)) FOR [Total]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderDetail](
[OrderID] [int] NOT NULL,
[OrderLineNumber] [int] NOT NULL,
[ItemID] [int] NOT NULL,
[OrderQty] [float] NOT NULL,
[Price] [money] NOT NULL,
[Total] [money] NOT NULL,
CONSTRAINT [PK__OrderDetail] PRIMARY KEY CLUSTERED
(
[OrderID] ASC,
[OrderLineNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderDetail] ADD CONSTRAINT [DF_OrderDetail_OrderQty] DEFAULT ((1.0)) FOR [OrderQty]
GO
ALTER TABLE [dbo].[OrderDetail] ADD CONSTRAINT [DF_OrderDetail_Price] DEFAULT ((0.0)) FOR [Price]
GO
ALTER TABLE [dbo].[OrderDetail] ADD CONSTRAINT [DF_OrderDetail_Total] DEFAULT ((0.0)) FOR [Total]
GO
|
|
|
|
|
i am using userdefined function LoadSubMenu("../UserControls/CategoriesMenu.ascx"); in masterpage which returns the string of CategoriesMenu.ascx controls. in that function i am using system defined function LoadSubMenu("../UserControls/CategoriesMenu.ascx").
when i am click the link (usercontrol control i.e. linkbutton) i want to change the cssclass for that particular control. how it is possible. please help me as early as possible.......
Regards
D.V.Mallikarjuna Guptha
|
|
|
|
|
Hi guys,
I am trying do develop an app using Dynamic Data Model.
So I set the relationships on the database and then drop the tables from the server explorer into the dbml file, when I run the app on my development machine everything works fine, I can update, insert and use the paging of the datagrid that was created.
But when I upload the site to our qa server I can only insert new values into the grid, if I try to page to the second page I receive the above error, or if I try to update an existing row it gives me an error stating that the row cannot be found.
Does anyone have an idea what might be causing this it would really be appreciated
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
We found the problem, it has something to do with the permissions, when we set the permissions to public access everything works, only problem is that it is running on our intranet and we don't want everyone to access the site.
Anyone have any ideas as to why this would happen?
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Good day.
In one of my pages it happens so i have more than one ImageButtons. One of them is used for Login and the others execute specific complex logic. The ImageButton object is represented as an "<input type="image" name="...." id="..." src="..." /> in the web browser.
I don't think i can avoid using more than one.
However when i click some of the other buttons ( which are not the "Login" button), browsers like Firefox get the annoying message "Do you want Firefox to remember this password?".
Is there a workaraund so i don't get that message ? (somekind of identifying which buttons is for login and which execute other logic ?)
Regards, Hris
|
|
|
|
|
HI,
I have some questions reg Asp.Net Net.Mail and Editors.
1) How to Track Bounce Emails?
2) is there any libraries to track bounced emails?
3) How to Check Spam Rate of a Message using C#?
4) Which is the Suitable Thid party editor for asp.net page suitable for Emails as well as document Generations.
I Expect answers from you guys
regards,
Sathak Musthafa H.M
|
|
|
|
|
|
I have developed a webpage.In my webpage I have a button on click of which some complicated data are fetched and it takes some time.But in between this if I move the mouse to some other links on the same page...the request is just lost.Has this problem any solution?
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: I have developed a webpage.In my webpage I have a button on click of which some complicated data are fetched and it takes some time.
OK at this stage your are processing something. You can show progress using some div and javascript code
ARINDAM1981 wrote: But in between this if I move the mouse to some other links on the same page...the request is just lost.Has this problem any solution?
Did you click on any link? How is just moving your mouse send you to link? Do you have mouse events handlers on the link?
|
|
|
|
|
Hi,
I have a web user control with a gridview.
What I am trying to do is to enable selecting of rows in the gridview.
I add a new simple select command column to the gridview(a simple linkbutton), but when I click on it nothing happens. I set the backColor of the selected row style to be blue in order to check if something changes and I relaized that the gridview doesn't change.
does anybody have any solution to my problem?
Thanks from advance, Ben
|
|
|
|
|
a first step to come to a solution might be placing your code.
Do you bind your grid again after you set the value for the row thas is selected?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|