|
I know RowDataBound will be fired for each row, but what is strange is that when i press a ButtonField of type image the code is executed twice. And so on for all ButtonFields in any gridview i create. Any suggestions?
|
|
|
|
|
Debug, set a breakpoint, check the call stack, etc.
only two letters away from being an asset
|
|
|
|
|
i had the same problem with you, but i don't konw why.i just created a new gridview and put the ButtonField in it again, then it work well.
|
|
|
|
|
I have installed VS2005 service pack 1 cause i read some where that this is a bug, but never worked. I have tried ur way also but still same problem.
thanks any way
|
|
|
|
|
Hi,
In my application I have one file upload control. When the user selectes a file to upload and when he clicks on Attach button I need to show him the file name of the file he selected to upload and also show the Remove link button after the file name. In this case I need to generate link button dynamically.
I wrote a code like the following:
protected void btnAttach_ServerClick(object sender, EventArgs e)
{
string strFileName = MyFile.PostedFile.FileName;
string c = System.IO.Path.GetFileName(strFileName);
listBoxAttachedFiles.Items.Add(c);
LinkButton b = new LinkButton();
b.Text = "Remove";
b.ID = "LB_" + b.Text;
b.Style.Add("display", "block");
listBoxLinks.Controls.Add(b);
//Panel1.Controls.Add(b);
}
With the above code it is showing only th file name in the listbox it is not showing the Remove button in the listboxlinks list box.
How to generate the link button and and write event when the remove is clicked i have to remove the corresponding file name from the other listbox.
Thanks in advance.
|
|
|
|
|
I may be asking a very obvious question but here goes:
Assume that the Web Server has a Database (an Access .mdb) for each User, the Tables, Fields, etc are the same in each Database, the WebMethods are the same for each User as are the Web Forms for their data.
Obviously I could setup a Service for each User and put the appropriate Database into it together its own copy of all the WebMethods, Web Forms, etc.
Equally obviously this is not the 'way to do it'; the coding overhead might be considerable!
So for each User I need to 'tell' the Server which OleDBConnection/Database to use. I just cannot see how this is done particularly if/when 2 or more Users are active at the same time.
Help would be appreciated.
I am using VS 2003 and coding with VB.
I don't need long, detailed explanations just a couple of pointers to get me going.
ollysmith
|
|
|
|
|
Seems an extraordinary setup, but anyway...
First, you need to know which user is making the request, so you'll need a login of some sort - so you need a "users" database and keep a reocrd for each user of their username, password, and database name - then when they login you can construct the appropriate database connection string from the information received from the database, and use that for their subsequent database requests. It won't matter if two or more users are logged in at the same time, they will each be accessing their own database using their own database connection.
I'm not sure how scalable this sort of setup is, if you have thousands or even just hundreds of users...
Fred
|
|
|
|
|
Fred_Smith wrote: I'm not sure how scalable this sort of setup is
Not very.
I would suggest using SQL Server Express.
only two letters away from being an asset
|
|
|
|
|
Thanks for replying Fred.
I can see how to do as you suggest but I also think you have hit upon the real difficulty that I have - It is an 'extraordinary problem' but this is because I have no idea how to tackle it and started with what I thought was a reasonable description. How wrong can one be!
I think now that what I need is a single Database and each Database request query has to contain the specific Users ID. I can maintain a Users Table and provide each User with some sort of a 'Key'or maybe a 'cookie' on their machine to identify them.
The program I have written is, at the moment for a single Cricket Club but 2 or 3 others have shown an interest and I want to rewrite the program to include them and their results, etc.
My biggest problem is that I am retired, over 70, self taught and noone now to float ideas with and be told I'm a fool.
If you are interested in Cricket let me know on djs@springfield.f2s.com and I will reply with a 'link' to the program I have written.
David Smith
|
|
|
|
|
Hello all;
I am using Asp.net 2.0 and I want to make form authencation in sub folder admin in my application is the following
- root
- admin
- App_Data
...
so web.config in root folder I have done the following :-
...
</system.web>
<location path ="Admin">
<system.web>
<authentication mode ="Forms" >
<forms loginUrl ="loginAdmin.aspx" defaultUrl ="Default.aspx"></forms>
</authentication>
<authorization >
<deny users ="*"/>
</authorization>
</system.web>
</location>
</configuration>
and give the following error
Server Error in '/Webauthentaction2' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: 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.
Source Error:
Line 40: <location path ="Admin">
Line 41: <system.web>
Line 42: <authentication mode ="Forms" >
Line 43: <forms loginUrl ="loginAdmin.aspx" defaultUrl ="Default.aspx"></forms>
Line 44: </authentication>
Source File: C:\Documents and Settings\magic\My Documents\Visual Studio 2005\WebSites\Webauthentaction2\web.config Line: 42
...................
I have made some search and I didnt get proff answer any one can help??
aj123
|
|
|
|
|
Hi,
I am developing one web application in .net 2.0.One page has 3 dropdown list.Drop down values loaded to the database and i need select specific value to the dropdown list.But i got the
"ERROR: Cannot have multiple items selected in a DropDownList".
The coding is below
Me.ddlParam.DataSource = dsParam
Me.ddlParam.DataTextField = "ParameterValue"
Me.ddlParam.DataTextField = "ParameterValue"
Me.ddlParam.DataBind()
Me.ddlParam.ClearSelection()
Me.ddlParam.Items.FindByText("Params").Selected = True
I tried many more ways.but i got the same error.
Pls help
Thanks in Advance
Anand
|
|
|
|
|
Are you resurrecting the value from ViewState and rebinding the columns at Postback. A !IsPostBack check might be missing.
|
|
|
|
|
try this
Me.ddlParam.selectedValue="Params"
Insted of Me.ddlParam.Items.FindByText("Params").Selected = True
Best Regard
Pathan
Plz vote If U got solution
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi,
Can anybody tell me how to generate an assembly from a resource file programatically
Thanks,
Prajin
|
|
|
|
|
I wish to format my gridview in such a way that,
Suppose there is a column "Description", which has been dynamically bound. It may be a 3000 chars long (max). Whatever the case, I wish to display only 2 lines (Approx 200 chars) using DIV tag, while displaying normally. Whenever the user mouseover on it, it should be displayed in the popup and show the detailed (full) content.
I am using export to excel also. Can u suggest any idea?
Jey
|
|
|
|
|
Jay_se wrote: Can u suggest any idea?
Use CSS and javascript
only two letters away from being an asset
|
|
|
|
|
Mark,
Too Generic answer !! ANYWAY thanks. The problem is that, I have been used the Template control& Bind the value to the Label control in the GridView.
Suppopse, if it contains 10 lines, I wish to show only the first two lines. Upon the user explicit request I may display the entire content there itseslf OR in seperate popup window.
You may suggest the outline(in Design). Its helpful to proceed further.
Jey
|
|
|
|
|
"Can u suggest any idea?"
I see, by this you mean, give me the code to do it.
How about we do a little exercise I like to call research. I'll even give you more of a hint. window.popup, style.text-overflow
only two letters away from being an asset
|
|
|
|
|
Mark, Good Morning. Thanks. I would like to learn. I never had the intension to get the code directly from this forum. Since I was worked with C#.Net (Creating BLL classes) for the past 2 years, I am a beginner in design.
Now I am having the opportunity to work in designing of web pages. So I am just learn & do my work. Its interesting too.
Mark Nischalke wrote: window.popup, style.text-overflow
Thanks for the hints.
Jey
|
|
|
|
|
I am using NUnit to test DLL components of a C# web app. All is working a treat except code that accesses the Web.Config file. As the DLL is being run through NUnit and not a webserver, it can't access the web.config file and falls over.
Is there a way I can explicitly tell the ConfigrationManager class to use a specific file to get its config settings? Something like
ConfigurationManager myMgr = new ConfigurationManager("c:\mywebfolder\web.config");
Cheers
Malc
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
1) Install TestDriven.NET, which integrates with Visual Studio,
2) copy the web.config file to MyDLLIamTesting.Config
3) Right Hand Mouse click - Run Tests
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
I ran into something like this a couple of years ago but with App.config. I added some post-build steps to keep everything in synch.
Kevin
|
|
|
|
|
Hi,
Anyone have idea about how to filter file types in asp.net file upload control. So that we ask user to select those files from Dialog box instead of regular exp/java script msg box.
Thanks
suparichit
|
|
|
|
|
I usually just put it through a conditional expression to check the file extension before the upload. Works pretty well.
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
thnq..
suparichit
|
|
|
|