|
|
Hi, i wonder a few question about something.
1.in my application, i would like to express that when i click the checkbox,
then show additional xolumns in the grid view.
i embodied coulumns with BoundField with gridview.
and i'd like to allied showing additional columns start with column ship(i.e, From column 'FCST Rev'
To column 'Vendor' are defalut.)
2. in my source, i'd like to combine the headerText.. is it possible function like colspan and rowspan in the girdview?
*ref code
<pre>
<code>
<td style="height: 385px; width: 398px;" valign="top">
<asp:GridView id="grvFcst" runat="server" AllowSorting="True" BorderWidth="0px" BorderColor="White"
CellPadding="0" AllowPaging="True" CellSpacing="1" AutoGenerateColumns="False" Width="100%" Font-Size="Smaller"
ForeColor="DimGray" OnPageIndexChanging="boardGrid_PageIndexChanging" OnRowDataBound="boardGrid_RowDataBound"
PageSize="20" >
<PagerSettings NextPageImageUrl="~/images/common/b_next.gif"
PreviousPageImageUrl="~/images/common/b_pre.gif" NextPageText="Next" PreviousPageText="Previous" />
<RowStyle HorizontalAlign="Center" Height="18px" />
<HeaderStyle BackColor="#D2E1E6" HorizontalAlign="Center" Height="20px" ForeColor="#336699" Font-Size="Small" />
<AlternatingRowStyle BackColor="#F1F4F5" HorizontalAlign="Center" />
<EmptyDataRowStyle HorizontalAlign="Center" Height="50px" VerticalAlign="Middle" />
<EmptyDataTemplate>
<table width="100%" height="100%">
<tr>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">No</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">FCST Rev</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">RTF Rev</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">S_mat_code</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">B_mat_code</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">B_Mat_Desc</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Buyer</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Vendor</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Ship</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Shot</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Inspect</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">CT</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Block</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Yield</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Status</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Capa</td>
<td style="background-color:#D2E1E6; color:#336699; font-size:small">Type</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="message" runat="server" Text="Data is not Found!" Font-Bold="true" Font-Size="Medium" />
</td>
</tr>
<tr height="2"><td bgcolor="#D2E1E6"></td></tr>
</table>
</EmptyDataTemplate>
<Columns>
<asp:BoundField HeaderText="No">
<ItemStyle Width="40px" />
</asp:BoundField>
<asp:BoundField HeaderText="FCST Rev" DataField="fcst_rev" />
<asp:BoundField HeaderText="RTF Rev" DataField="rtf_rev" />
<asp:BoundField HeaderText="S_mat_code" DataField="ref_ms" />
<asp:BoundField HeaderText="B_mat_code" DataField="ref_m1" />
<asp:BoundField HeaderText="B_Mat_Desc" DataField="ref_desc" />
<asp:BoundField HeaderText="Buyer" DataField="Buyer" />
<asp:BoundField HeaderText="Vendor" DataField="Vendor" />
<asp:BoundField HeaderText="Ship" DataField="st_ship" />
<asp:BoundField HeaderText="Shot" DataField="st_shot" />
<asp:BoundField HeaderText="Inspect" DataField="st_inspect" />
<asp:BoundField HeaderText="CT" DataField="st_ct" />
<asp:BoundField HeaderText="Block" DataField="st_block" />
<asp:BoundField HeaderText="Yield" DataField="st_yield" />
<asp:BoundField HeaderText="Status" DataField="st_status" />
<asp:BoundField HeaderText="Capa" DataField="st_capa" />
<asp:BoundField HeaderText="Type" DataField="" />
</Columns>
<PagerStyle HorizontalAlign="Center" CssClass="pagerStyle" />
</asp:GridView>
</td>
</code>
</pre>
modified on Monday, May 11, 2009 10:21 PM
|
|
|
|
|
Whether you're advanced in db40 and want increased efficiency or you want to learn basic operations, you'll find what you're looking for in this free, 6-page DZone Refcard. Download at: http://refcardz.dzone.com/refcardz/getting-started-db4o?oid=hom10401[^]
db4o is an open source object database that allows you to quickly store and retrieve your .NET application data. This DZone Refcard walks you through db4o's basic operations, its various query types and techniques for optimal data access performance.
About the Authors:
Prof. Dr. Stefan Edlich is a senior lecturer at Beuth University of Technology Berlin (App.Sc.) with a focus on Object Databases, Software-Engineering and E-Learning. He sold his first commercial software in 1986 and has a 26 year software development experience. Furthermore he is the author of ten IT books he wrote for Apress, OReilly, Spektrum / Elsevier, and other publishers. In 2008 he set up the the worlds First International Conference on Object Databases (ICOODB.org) which is continued 2009 at ETH-Zürich.
Eric Falsken is a longtime web and embedded software developer. He wrote his first of many websites in 1995, and went on to e-commerce, enterprise and internet media before shifting his focus to embeded device software, where he found his love of object databases and db4o. Eric has been a member of the db4o team since 2006, and enjoys travel adventuring, meeting new people, and looking at beautiful code.
|
|
|
|
|
I have a bak file. How can I add file into a Web application in VS 2008
|
|
|
|
|
You question is not clear.
What kind of .bak file you have. Is it SQL server database backup file. If so, Do you want to resore a SQL Server database .BAK file.
Or do you want to upload a .bak file using your web application?
|
|
|
|
|
hahii wrote: I have a bak file. How can I add file into a Web application in VS 2008
I didn't get you?
Does that .bak file contain you project database?
|
|
|
|
|
this.page.ClientScript.RegisterStartupScript(this.GetType(), "cpjs", "<script type=\"text/javascript\" src=\"wcpjs.js\"></script>");
and I have all the javascript functions I need in wcpjs.js. However I get object not found errors. If I replace the src=" ...." part with a test function like "function test(){alert('i hate javascript');}"
then no problem no error.
I have tried using src=\" differentpath\\wcpjs.js\" but to no avail. Still get errors.
Have spent a full day on this now and am
If anyone can answer this - when I get rich I'll send you some big bucks.
|
|
|
|
|
this is the line of code - some got cut off.
this.page.ClientScript.RegisterStartupScript(this.GetType(), "cpjs", "<script type=\"text/javascript\" src=\"wcpjs.js\" ></script>");
thanks.
|
|
|
|
|
I am creating my own richtext editor. The text will be loaded from database, and user should be able to update and save it back to the database.
when user place the cursor at a text of a 'bold', 'underlined' word, how do I know the text properties? or the start cursor position?
Thanks in advance
Lin
|
|
|
|
|
I would suggest Web development[^] forum as your question has nothing to do with ASP.NET.
|
|
|
|
|
I'm trying to replace some text in a datagrid's textbox on edit. I've done this a thousand times, but I'm not seeing the problem. Stops on "tada" line with Object reference not set to an instance of an object. Any help appreciated.
Protected Sub dgAnswers_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgAnswers.ItemCommand
If e.CommandName = "Edit" Then dgAnswers.EditItemIndex = e.Item.ItemIndex CType(dgAnswers.Items(e.Item.ItemIndex).FindControl("txtAnsEdit"), TextBox).Text = "tada"
|
|
|
|
|
I think you should break your statements into different parts. Do you feel pressured to stick all those functions on one single line? Doing this will allow you to see the problem more quickly, fix it and move on. This example probably has bugs in it, but try something like this:
If e.CommandName = "Edit" Then
dgAnswers.EditItemIndex = e.Item.ItemIndex
Dim txt as Textbox
txt = CType(dgAnswers.Items(e.Item.ItemIndex).FindControl("txtAnsEdit"),TextBox)
If not isnothing(txt) then
'since you have the object reference assigned to txt, assign the value using this alias
txt.Text = "tada"
Else
'Could not find the textbox.
End if
End If
|
|
|
|
|
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.
|
|
|
|
|
EliottA wrote: So how would I go about making a login script and creating a session?
I am not sure that I got your question correctly. Are you asking how to validate the user login and create a session for user? If yes, that sounds pretty trivial.
You have to classify the types of users and restriction levels required in your website. Assuming you have two kinds of users, a normal user and administrators. Create a class that derives from System.Web.UI.Page , say WebPage . Since you have two types of restriction levels, create two classes NormalUserPage and AdminPage both derived from WebPage and contains security checking for each type.
If a page in your website has normal user access rights, derive the page from NormalUserPage . If it requires administrator rights, derive from AdminPage . This method helps you to add/remove certain user types with minimal code change.
Is that what you are looking for?
|
|
|
|
|
Thanks for the help, yes that's pretty much what I was looking for description wise. But how to create a session and keep track of it is more of what I was looking for, also while using the Web.config to restrict users from areas of the site based off their permission or role.
N a v a n e e t h wrote: If yes, that sounds pretty trivial. That's because I'm a beginner, stuck on a trivial part
|
|
|
|
|
|
Hey friends! I m a regular viewer of CODEPROJECT. I m designing an application for a software firm. In Login form , during (Response.redirect) an error is encounterd saying that"Threat was being aborted."
I tried
"server.transfer(url,false)"
"response.redirect(url,false)"
but it does not redirect to the target link instead it stays back to the current page.please help me out.
THanks in advance.
modified on Monday, May 11, 2009 8:57 AM
|
|
|
|
|
The ThreadAbortException is normal for a page redirect. It isn't an error.
If you are catching exceptions, you must allow this one through.
try
{
}
catch(ThreadAbortException)
{
throw;
}
catch(Exception ex)
{
}
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Colin Angus Mackay wrote: throw; // Continue throwing the ThreadAbortException
I think this is not required as ThreadAbortException will be raised again automatically at the end of catch block.
|
|
|
|
|
N a v a n e e t h wrote: I think this is not required as ThreadAbortException will be raised again automatically at the end of catch block.
Really? Anyway, if you are catching other exceptions where the scope includes ThreadAbortException, you don't want to be processing stuff unnecessarily.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Colin Angus Mackay wrote: Really?
Yup. Quoting MSDN,
ThreadAbortException is a special exception that can be caught, but it will automatically be raised again at the end of the catch block. When this exception is raised, the runtime executes all the finally blocks before ending the thread.
|
|
|
|
|
thanks, but it's not working.
|
|
|
|
|
priya1515s wrote: but it's not working.
Define "not working" - I'm not a mind reader.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
priya1515s wrote: but it does not redirect to the target link instead it stays back to the current page.please help me out.
It may be possible that you are catching and suppressing this exception, thus not allowing it to continue up to the top to allow ASP.NET to handle it.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
"not working" meaning that the same problem occurs again.the page is not redirecting and stays back.
|
|
|
|