Web Forms :: Manipulate And Get The Result Statements Dynamically?
Dec 14, 2010I would like to manipulate and get the result the following statements dynamically. I have string value in followinf format.
[Code]...
I would like to manipulate and get the result the following statements dynamically. I have string value in followinf format.
[Code]...
In my Admin page, I have a drop down list containing all current user tables in the database. The user chooses one.
My DetailsView below uses that parameter to populate itself with data from that table. The stored procedure used to select the data passes a string to sp_executesql. The string is concatenated from a select statement and the tablename parameter. Can I do something similar for Update/Delete statements? I'm not sure of the best approach, given that I won't know which/how many fields will be in the DetailsView at runtime, and which of these are keys - the choice of table depends on the user. I think Insert will be straightforward - am I right? I would like to streamline things as far as possible. Is it possible to dynamically pass in the values in, say, a string, and get my stored procedure to understand them? And what's the best method of grabbing the values from the DetailsView in this situation?
I'm using the 'Configure Data Source' wizard to connect to my database and show the dataset in Gridview. I want to be able to update, insert and delete entries but am unsure how to build the query. I can write simple update statments to change database entries but how can I do this for entries that have been changed within the gridview?
View 6 RepliesI have a page to show a thread content, it take the ID of the thread from the query string.
depending on the ID, I show the content using the FormView control.
how could I then change the page title depending on the databinding result?
I've figured out that I can do that before the databinding in the Page_Load event, by querying the title of the thread depending on the ID from the QueryString object, but I'm wondering if I can achieve my goal during the databinding!
I have this ListView that has a Drop Down List.Everything works fine (I think/hope) except that the drop down list are not showing its result correctly.This is the code.
Front-End
[Code]....
The code behind consist of the page_load and the ItemDataBound
[Code]....
I have a listview I'm using to show some data. My question is, how do I manipulate that data being presented. For example, I have a label in my listview template that looks like this:
<asp:Label
ID="lblTerminalA"
runat="server"
Text='<%= Eval("MOT")%>'
/>
The listview's datasource is a datatable. lets say that data when presented looks like "SOME COMPANY NAME T4220" I only want to write to the screen "T4220" and trim off the stuff before it. How do I go about doing this?
I want to access to asp.net controls like button, label, .... from html mode(desinge mod
for example i have following control :
<asp:LinkButton
ID="lnkbtnRemove"
Text=""
CommandArgument='<%#Eval("AdsID") %>'
CommandName="DelFav"
runat="server"></asp:LinkButton>
I want something like this in html codes to manipulate control:
<%# if( condition)
lnkbtnRemove.Visible=false;
else
lnkbtnRemove.Visible=true;
%>
I have a Masterpage which contains two contentpalceholder, first one for a Usercontrol and second one for my web forms.
Now I want to change the usercontrol's property of sqldatasource from out side of usercontrol such as some web forms. Can I access objects of usercontrol from the other web forms or masterpage?
I have a simple problem. What i wish to do is to read the data bound item [Code]....
and if the output = 0 then rather than display the 0 I would like to display a message such as Not Available.
Can anyone provide a solution?
is there a way to manipulate a piece of a File path in a ImageUrl of an asp image?
Ex: <asp:Image ID="helpButton" ImageUrl="images/HelpButtonsA/buttons/help.png" runat="server"/>
I would like to change HelpButtonsA dynamically to HelpButtonsB(assuming that the path "images/HelpButtonsB/buttons/help.png" exists.) Can it be done by setting a public variable in the code behind then using that variable in the path?
I'm having a problem with my Linq to XML query. I'm getting the result data I want, but it's nested so deep that there must be a better way.Here is my XML:
[Code]....
I'm trying to get a list (simple string[]) of all Item IDs where Category Names contains "Other".Here is my Linq:
[Code]....
[Code]....
Here is a snapshot of my result from Visual Studio:The results I want are there ("item100", "item400", "item500"), but buried so deeply in the results var.
How can I get the query to return a simple
string[] = { "item100", "item400", "item500" }
Index outof range?GridView2.Columns[6] as BoundField I use Auto-generate field .
How to manipulate GridView2.Columns as BoundField with auto-generate field?
[code]....
its my code where I giving out paging of view:
<div style="float: right;">
<%= Html.RouteLink("<<", new { page = 1 }, new { title = "first page" })%>
<% if (this.Model.HasPreviousPage) [code]...
it looks like this:
<< 1 2 3 > >>
I want to show always just a two pages before and after selected page.If Iam on page 4, I will see all 3 pages before like this.
<< < 1 2 3 **4** > >>
how to manipulate this.
my model has following data for paging:
/// <summary>
/// Gets the boolean value of previous page
/// </summary>[code]....
I want to change some elements text when page is leaving the server (page_render, endRequest etc.).
How can i get access to the page and how can i find the elements to change their values, texts?
have a situation very similar to the one in this question:http://stackoverflow.com/questions/774695/selective-cache-clearing-across-load-balanced-servers-asp-netThe difference is that due to our hosting configuration, I am unable to address individual servers by IP address. Assuming I cannot access specific servers via web requests, is it possible to access the HttpContext of a web application running on the same machine? I'm thinking I could accomplish this with a windows service that I could address by machine name, or alternately a console application
View 1 RepliesI have an LDAP path and I only want the OU's from it. How can I manipulate it to get the OU's??
e.g.
LDAP://company.com/OU=MyOU,DC=MyCompany,DC=com
to be show as MyOU
LDAP://company.com/OU=MyOU1,OU=MyOU2,DC=MyCompany,DC=com
to be shown as MyOU1/MyOU2
LDAP://company.com/OU=MyOU1,OU=MyOU2,OU=MyOU3,DC=MyCompany,DC=com
to be shown as MyOU1/MyOU2/MyOU3
multiple groups of users interacts using browser. in each group, users will interact with some data(objects). the data(objects) are loaded from database. during the interaction, users needs quick and synchronized view of the same data(object), so they must be save in the memory. data(objects) will change during the interaction, but only the final result of this interaction need to be saved back into DB.
My Current Solution
load data(object) into global.asax the manipulate. but for this solution, i got few questions.
how can i make sure the web application have ONLY ONE instance?(configure in iis-->application pool?) because web application would restart by itself, as a result, all data in the application state will lose. how can i avoid application restart by it self rather than managed? in the iis application pool setting, i can set the recycle time, is it guaranteed that no application restart will happen during this time? or is there and event that might trigger something(before application restart) so i can save the current application status and load them back again?
I have a BasePage class that all of my content pages inherit from. In my BasePage, I have many Import Statements. It seems as though they carry over into the derived class as one would expect. However, if you were to try and access code in the client aspx design page, as you would in the code-behind, you run into problems.
For instance, in my BasePage i have a Public Enum named ThemedSites. It's just an enumerator that lists the 5 different themes my site could be skinned as. I, at times, need to do different things in code, and in design, depending on what theme I'm currently in. I have a Public Property named CurrentSite (might have been more appropriate to say CurrentTheme, but that's besides the point). CurrentSite's return type is ThemedSites. So in code, one would say something like:
[Code]....
This works great in any page that inherits the BasePage class. This falters when that very same logic is used in the design page like:
[Code]....
Now, it works if you fully qualify both sides of the condition, but that's not my question. My question is: why isn't the Imported NameSpace in the BasePage recognized in the client-side server tag, as one would think it would be, according to how it IS recognized in the server-side code-behind?
look at the following code
[Code]....
The last three statments produces the same effect. Which one is better and mostly used?
I've got the following Setup in my Theme:
App_ThemesDefaultStyleSheet.css
App_ThemesDefaultPrintStyleSheet.css
The PrintStyleSheet.css file has a set of printing css rules set in them wrapped in an @Media Print { } block.
I need a way to programmatically remove the PrintStyleSheet.css from the list of css files for ASP.NET to inject based on some flags. (Some instances we want to print the site verbatim without custom formatting).
I know i could build a seperate theme without the PrintStyleSheet.css in it and switch the theme programmatically, however this would introduce duplication of my master stylesheet which is not acceptable.
Although it may not seem like that but there is a little questions about this subject.I am not asking if I should use DB or filesystem, the file system it is, but I am asking what is the best way of organizing pictures in file system that will be used with asp.net application? I am talking about tens or even hundreds of thousands of picture.
To elaborate a question a bit.
Where should repository be located, create another VD in IIS or in application VD, or somewhere outside IIS?
How to organize file patsh, put them all in one folder or create subfolders. If so how to name all those folders?How to handle multiple sizes of the same image? where to locate them?How to sync folders and images with database?What else crosses your mind, and you think it's important..
I've done something myself allready, but I am asking if someone had some experience with this. Maybe it could be done better yours way.
I put things like this
I stored pictures in IIS folder, because storing them outside of iis make them unable to use in web, because of paths. You cannot use file path in web, it must be virtual file path.
http://images/1.jpg istead of C:images1.jpg
in the root I had subfolder for each picture size
root-
+400x300
+600x400
+1024x768
Named images by id from database. If the ImageID from database is 45678909, the name of picture is 45678909.jpg an it's location is
VDimages400x30045678945678909.jpg
VDimages600x40045678945678909.jpg
I sliced the picture name two by two, and create subfolders. the point was not to have more than 100 files in folder. Was this good idea or stupid one? How would you organize this? For person, this organization with tons of folder is not easy to use.
Name of the image with its relative path I saved in database table with description and time of insert etc. path: 45678945678909.jpg
I am new to the whole MVP thing and slowly getting my head around it all. The a problem I am having is how to stay consistent with the MVP methodology when populating GridViews (and ddls, but we will tackle that later).
Is it okay to have it connected straight to an ObjectDataSourceID? To me this seems wrong because it bypasses all the separation of concerns MVP was made to do.
So, with that said, how do I do it? How do I handle sorting (do I send over handler events to the presentation layer, if so how does that look in code)? Right now I have a GridView that has no sorting. Code below.
[Code]....
I create my own litte ViewEngine, done many things that works great, but now I want something to implement, but I don't know how.
I want the final Response Content when the controller is executed and the view is executed, manuelly manipulate and than send to the client.
I have two Examples for it.
First I have an AssetManager, he collects all Css files and JavaScript files, given by components, the view, classes and so on.
And this collected links I will insert with String.indexOf before the "</head" tag.
The reason why I want do this in the engine and not with a line like this in the head part
[Code]....
Is that I want so save me the work to do this every time on each project in the master page and maybe in single views.
A second usefull idea is, I want to write my own litte trace component, and I want so write the generated content before the "</html>" tag.
where I can manipulate the content before sending it to the client, and this in the engine?
I'd like to know which are the best practise to easily manipulate excel files.I need to do only simple actions: create new file, add new sheets, populate cells from a dataset and add calculate cell.Is there something build-in visual studio or have I to use some third part tools?
View 4 RepliesI have a GridView :
[code]....
I want to query the value of a particular field in a DB and if it's true, display the LinkButton. if false, I want the linkButton not to be displayed.
is there a way to access the GridView programmatically and make visible certain of its columns or manipulate its items ?