|
Hello Brothers pls helpme,
I want to create bogagregator site .
users can update blog'posts or url and title.
usres can rerieve it (title) as links from database to gridview .
How can i make titles are the links of posts(urls)
here is the code:
<>
&lt;asp:GridView ID="GridView1" runat="server" CellPadding="4" Font-Bold="True" Font-Names="Courier New"
Font-Size="13pt" ForeColor="#333333" GridLines="None" Style="z-index: 119; left: 17px;
position: absolute; top: 422px" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"&gt;
&lt;FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt;
&lt;RowStyle BackColor="#CCCCFF" ForeColor="#333333" /&gt;
&lt;EditRowStyle Font-Bold="True" ForeColor="#804000" /&gt;
&lt;SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /&gt;
&lt;PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /&gt;
&lt;HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt;
&lt;AlternatingRowStyle BackColor="White" /&gt;
&lt;Columns&gt;
&lt;asp:BoundField DataField="title" HeaderText="title" SortExpression="title" /&gt;
&lt;asp:BoundField DataField="url" HeaderText="url" SortExpression="url" /&gt;
&lt;asp:BoundField DataField="languages" HeaderText="languages" SortExpression="languages" /&gt;
&lt;asp:BoundField DataField="categories" HeaderText="categories" SortExpression="categories" /&gt;
&lt;asp:BoundField DataField="description" HeaderText="description" SortExpression="description" /&gt;
&lt;asp:BoundField DataField="author" HeaderText="author" SortExpression="author" /&gt;
&lt;asp:BoundField DataField="city" HeaderText="city" SortExpression="city" /&gt;
&lt;asp:BoundField DataField="country" HeaderText="country" SortExpression="country" /&gt;
&lt;asp:BoundField DataField="date" HeaderText="date" SortExpression="date" /&gt;
&lt;/Columns&gt;
&lt;/asp:GridView&gt;
|
|
|
|
|
Simple way is to use template field and a Hyperlink field inside that template field.
|
|
|
|
|
<asp:ScriptManager runat="server" ID="ScriptMangaer1">
</asp:ScriptManager>
<div id="MainBody" class="MainBody">
<table>
<tr>
<td>
<table>
<tr>
<td>
<asp:UpdatePanel ID="updtpnlDDL" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="True" >
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server"
Category="Category"
TargetControlID="ddlCategory"
PromptText="Category"
LoadingText="Please Wait..."
ServicePath="FindCategory.asmx" ServiceMethod="GetCategoryWithAll">
</ajaxToolkit:CascadingDropDown><br />
<asp:DropDownList ID="ddlSubCategory" runat="server" AutoPostBack="True">
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server"
Category="SubCategory"
TargetControlID="ddlSubCategory" ParentControlID="ddlCategory"
PromptText="Sub Category"
LoadingText="Please Wait..."
ServicePath="FindCategory.asmx" ServiceMethod="GetSubCategoryWithAll">
</ajaxToolkit:CascadingDropDown>
<asp:Button ID="btngo" runat="server" OnClick="btngo_Click" Text="Go" />
</ContentTemplate> </asp:UpdatePanel>
</td>
<td valign="top">
</td>
</tr>
</table>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanelCat" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DataList runat="server"
id="dlCategory"
CellPadding="0"
CellSpacing="0"
RepeatDirection="Horizontal"
RepeatColumns="3">
<HeaderTemplate>
<h3>
Category Details
</h3>
</HeaderTemplate>
<ItemTemplate>
<div class="CurrentNews">
<table>
<tr>
<td>
<b> <%#Eval("CatName")%> </b><br />(<%#Eval("CatDescription")%>)
</td>
</tr>
<tr>
<td colspan="1">
<div class="BorderRing">
<img src='../Handler.ashx?Size=S&ImageID=<%# Eval("ImageId") %>' alt='Thumbnail Photo of <%# Eval("ImageId") %>' />
</div>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanelSubCat" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DataList runat="server"
id="dlSubCategory"
CellPadding="0"
CellSpacing="0"
RepeatDirection="Horizontal"
RepeatColumns="3">
<HeaderTemplate>
<h3>
SubCategory Details
</h3>
</HeaderTemplate>
<ItemTemplate>
<div class="CurrentNews">
<table>
<tr>
<td>
<b> <%#Eval("SubCatName")%> </b><br />(<%#Eval("SubCatDescription")%>)
</td>
</tr>
<tr>
<td colspan="1">
<div class="BorderRing">
<img src='../Handler.ashx?Size=S&ImageID=<%# Eval("ImageId") %>' alt='Thumbnail Photo of <%# Eval("ImageId") %>' />
</div>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
</td>
</tr>
</table>
<table>
<tr>
<td>
<asp:LinkButton ID="lnkCategory" runat="server">Add New Category</asp:LinkButton><br />
<asp:LinkButton ID="lnkSubCategory" runat="server">Add New Sub Category</asp:LinkButton>
</td>
</tr>
</table>
<ajaxToolkit:ModalPopupExtender ID="ModalPopUpforCategory"
runat="server"
BackgroundCssClass="modalBackground"
DropShadow="true"
PopupControlID="pnlCategory"
TargetControlID="lnkCategory"
CancelControlID="btnClose" >
</ajaxToolkit:ModalPopupExtender>
<asp:Panel id="pnlCategory" runat="server" style="display:none" cssclass="modalPopup">
<asp:UpdatePanel runat="server" ID="updatePanelCategory" UpdateMode="conditional">
<ContentTemplate>
<asp:DetailsView ID="dvCategory"
runat="server"
AutoGenerateRows="False"
AllowPaging="True"
DataKeyNames="CatCode"
CssClass="dvTextAlign">
<Fields>
<asp:TemplateField HeaderText="Category Code">
<EditItemTemplate>
<asp:TextBox ID="txtCatCode" runat="server" Text='<%# Bind("CatCode") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtCatCode" runat="server" ></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCatCode" runat="server" Text='<%# Bind("CatCode") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category Name">
<EditItemTemplate>
<asp:TextBox ID="txtCatName" runat="server" Text='<%# Bind("CatName") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Category Name is Necessary" ControlToValidate="txtCatName" Display="None"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" HighlightCssClass="ValidCheck" >
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtCatName" runat="server" Text='<%# Bind("CatName") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Category Name is Necessary" ControlToValidate="txtCatName" Display="None"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" HighlightCssClass="ValidCheck" >
</ajaxToolkit:ValidatorCalloutExtender>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCatName" runat="server" Text='<%# Bind("CatName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<custom:longtext DataField="CatDescription" HeaderText="Category Description" Height="100px" Width="250px" />
<asp:TemplateField HeaderText="Hot Category">
<EditItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server">
<asp:ListItem Selected="True" Value="N">Normal</asp:ListItem>
<asp:ListItem Value="H">Hot</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server">
<asp:ListItem Selected="True" Value="N">Normal</asp:ListItem>
<asp:ListItem Value="H">Hot</asp:ListItem>
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblHotCategory" runat="server" Text='<%# Bind("HotCategory") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
<tr>
</tr>
<tr>
<td><img src='../Handler.ashx?Size=S&ImageId=<%# Eval("ImageId") %>' class="photo_198" style="border:2px solid white;width:50px;" alt='Thumbnail of Photo Number <%# Eval("CatName") %>' /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="fUpPhoto" runat="server"/>
</EditItemTemplate>
<InsertItemTemplate>
<asp:FileUpload ID="fUpPhoto" runat="server"/>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<EditItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
<div style="text-align: right; width: 100%; margin-top: 5px;">
<asp:Button ID="btnClose" runat="server" Text="Close" Width="50px" CausesValidation="False" />
</div>
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupForSubCategory"
runat="server"
BackgroundCssClass="modalBackground"
DropShadow="true"
PopupControlID="pnlSubCategory"
TargetControlID="lnkSubCategory"
CancelControlID="btnClose" >
</ajaxToolkit:ModalPopupExtender>
<asp:Panel id="pnlSubCategory" runat="server" style="display:none" cssclass="modalPopup">
<asp:UpdatePanel runat="server" ID="updatePanelSubCategory" UpdateMode="conditional">
<ContentTemplate>
<asp:DetailsView ID="dvSubCategory"
runat="server"
AutoGenerateRows="False"
AllowPaging="True"
DataKeyNames="SubCatCode"
CssClass="dvTextAlign">
<Fields>
<asp:TemplateField>
<EditItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server">
</asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server">
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCategory" runat="server" Text='<%# Bind("CatName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SubCategory Code">
<EditItemTemplate>
<asp:TextBox ID="txtSubCatCode" runat="server" Text='<%# Bind("SubCatCode") %>' ></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtSubCatCode" runat="server" Text='<%# Bind("SubCatCode") %>' ></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblSubCatCode" runat="server" Text='<%# Bind("SubCatCode") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SubCategory Name">
<EditItemTemplate>
<asp:TextBox ID="txtSubCatName" runat="server" Text='<%# Bind("SubCatName") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="SubCategory Name is Necessary" ControlToValidate="txtSubCatName" Display="None"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" HighlightCssClass="ValidCheck" >
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtSubCatName" runat="server" Text='<%# Bind("SubCatName") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="SubCategory Name is Necessary" ControlToValidate="txtSubCatName" Display="None"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" HighlightCssClass="ValidCheck" >
</ajaxToolkit:ValidatorCalloutExtender>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblSubCatName" runat="server" Text='<%# Bind("SubCatName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<custom:longtext DataField="SubCatDescription" HeaderText="SubCategory Description" />
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
<tr>
<td><img src='../Handler.ashx?Size=S&ImageId=<%# Eval("ImageId") %>' class="photo_198" style="border:2px solid white;width:50px;" alt='Thumbnail of Photo Number <%# Eval("SubCatName") %>' /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="fUpPhoto" runat="server"/>
</EditItemTemplate>
<InsertItemTemplate>
<asp:FileUpload ID="fUpPhoto" runat="server"/>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
<div style="text-align: right; width: 100%; margin-top: 5px;">
<asp:Button ID="Button1" runat="server" Text="Close" Width="50px" CausesValidation="False" />
</div>
</asp:Panel>
</div>
|
|
|
|
|
Actually there is problem with Validation remove the Validation All r working Fine.Thank You
|
|
|
|
|
Hi...
I have developed a site through ASP.NET using VB. Whenever i go to the site, I am only able to visit the static pages. As soon as I try to visit any page linked to registration completion or the login completion, I am getting the following error:
"Server error in / Application"
Please reply as soon as possible for the solution to the given issue...
Thanks n Regards,
Gaurav
|
|
|
|
|
Could you please tell the details of the error.
One possible reason may be that you are not able to connect to Database. Please check connection string and database connection.
|
|
|
|
|
Hi Anurag.... thanx for the response... The complete error code that is visible to me is as follows:
"Server Error in / Application"
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
|
|
|
|
|
Hi all,
I am new to sapi 5.1.I am using this in an web application.Actually my requirement is to produce mp3 format as output using sapi 5.1.I can able to get wav as output.I dont want any third party sofwares to convert this.I want sapi only to get mp3 as output.Can anyone plz help me.i am running out with this issue for past 1 week.
|
|
|
|
|
Hi Friends,
I have data in excel and i want to transfer data from excel to datagrid,
having columns name,date of join and salary,how can i transfer excel data
to grid. pls let me know how to make the connection, can you send the code for that.
Regards,
Arpita
|
|
|
|
|
First of all, if you want to show your Excel data in a datagridview on an aspx page, you have to upload that spreadsheet onto the server. Best way - use the FileUpload control.
I'm only going to show you one way of doing what you want to do. If you don't like it, at least you'll have some reference on how to approach it.
To "make the connection" with an excel spreadsheet, you need to add reference to Interop.Excel.dll, Interop.Microsoft.Office.Core.dll and Interop.VBIDE.dll in your project first.
Then, in your code:
using System.Data.OleDb;
private void ExcelToGrid()
{
DataTable dt = new DataTable("sheet");
OleDbConnection conn = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + MapPath("Yourfilename.xls";extended properties=Excel 8.0");
OleDbDataAdapter SheetAdapter = new OleDbDataAdapter("select * from [$Sheet1]", conn);
SheetAdapter.Fill(dt);
DataGridView1.DataSource = dt;
DataGridView1.DataBind();
}
That should really do the trick. Obviously, you need to change $Sheet1 to whatever your sheet is called in the spreadsheet. And read up on versions of the Jet engine - i can't guarantee it's gonna work with all the living versions of Excel.
var question = (_2b || !(_2b));
modified on Monday, February 23, 2009 7:05 AM
|
|
|
|
|
I was doing it by defining the Table Name to the Range of cells required to read/write. On Writing to excel it will automaticallly insert new row to that table.
That way, it will not depend on the sheet and structure will become more similar to other database. Because from database, you are retrieveing data from table and not from sheet.
That's my personal view.
|
|
|
|
|
Far as I'm concerned, he wanted to read data from an excel spreadsheet and put it into a datagridview.
There was nothing in the email indicating he also wanted to WRITE in the excel document. Nothing about any databases either.
The JET engine treats a spreadsheet like a table, far as I'm concerned.
Plus I'm sorry, i did not quite understand the part where you say:
"On Writing to excel it will automaticallly insert new row to that table."
What table? The DataTable?
var question = (_2b || !(_2b));
|
|
|
|
|
Greg Chelstowski wrote: On Writing to excel it will automaticallly insert new row to that table
I meant Table defined in Excel there.
Ok, I agreed with you.
Thanks.
|
|
|
|
|
Too much code in google , just google it
|
|
|
|
|
HI Greg,
Thanks for this ,but i am using visual studio 2003 and c#, can i use ur code in windows forms,i tried and it is not working as below:
OleDbConnection conn = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + MapPath("data.xls",extended properties="Excel 8.0")); -- throws syntax error
please can u help.
Arpita
|
|
|
|
|
Yes you can use this code in Windows Forms, for the most part.
As there is no
Server.MapPath class in Windows Forms you have to find a different way of pointing to the Excel spreadsheet (as in, provide the application with the physical path to your .xls file).
This is an ASP.NET forum, that's how i gathered you were using WebForms.
So it should really be:
string PathToFile = "";
OleDbConnection conn = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source="+PathToFile+";extended properties=Excel 8.0");
var question = (_2b || !(_2b));
|
|
|
|
|
hi friends ,
How to make a context menu to JQGrid ? .Could you please help me ?
With Warm regards.
dyno.
|
|
|
|
|
I think you can use some javascript UI lib. etc jquery UI.
|
|
|
|
|
Hi, we need to create a site that is going to be developed by 3 people. We are going to use visual studio 2008. Once I heard that the best way to work is to create 2 solutions 1 for the code and one for the site. is this correct? If not how should we work? I have set up a source control service to keep all our source code in sync. We are students and never worked in a team to develop a site.
|
|
|
|
|
Clifweb wrote: We are students and never worked in a team to develop a site.
Fair enough.
Clifweb wrote: create 2 solutions 1 for the code and one for the site
This just plain won't work. Unless you mean to create a separate dll for the business layer, that's commonly done, but to try to create two seperate projects with the idea that you can work apart and bring them together at the end, that's fairly untenable. There's a number of free source control programs like Subversion and CVS, which you can use to set up a machine to hold the projects and then allow everyone working on it to grab code from the common repository and work on it that way.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
So I Should create one solution (Web Application)and all my friends use the subversion to keep it up to date?
|
|
|
|
|
I would read up on n-tiered development. It's a good idea to move the business logic away from the presentation tier, in a dll, but I would still use subversion to work together on the project, yes.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I am developing web application, In which ,i have used Enterprise library 4.0 for data validation.
Previously it was single language(English) project but now another one language(Dutch)is added to this project.
Previously ,i have used english lang to display validation message now i want to displayed localized message for both language(English and Dutch).
Does anyone provide some information or link over this?
|
|
|
|
|
Hi guyz i have used script manager & update panel in my page...
i am getting error as:
Error 126 The type or namespace name 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)
Error 127 The type or namespace name 'UpdatePanel' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)
What kind of assembly referencei have to include in web.config file,
plz give me the set of lines have to include in that config file...,
I included web.extension assembly refrence eventhough i am egtting this error...,
Plz tell me to solve this error...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
I assume you don't have the ASP.NET AJAX library installed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|