|
Hi
I'm new in asp.net, Now i'm developing a project for a news agency. I stored fields about news like NewsTitle, NewsBrief,NewsDate,... in database. I want to show custom news (for example last 10) in a home page. Which control i should use? Each news containg title, breif, small picture and the news.
Should i use panel control or i should add table programmatically to the page?
Please Help, Tanx.
|
|
|
|
|
I'd use a repeater, to give me full control over how each item is rendered, and make it's data source a collection of NewsItem objects (a class you create )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear Christian
Sorry! Your answer is not completely usefull. Can you give me a source? Is repeater a control or its Custum control you created for yourself? How youu add that to your page?
Tanx
|
|
|
|
|
HI Reapeter is ASP.NET 2.o server control you can add it by simply drag and drop from control panel to your page ...
If you want some code please search on google for it definalty you will get many sites best of luck
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The Repeater Web server control is a container control that allows you to create custom lists out of any data that is available to the page. The Repeater control does not have a built-in rendering of its own, which means that you must provide the layout for the Repeater control by creating templates. When the page runs, the Repeater control loops through the records in the data source and renders an item for each record.
Repeater Web Server Control[^]
Regards,
Satips.
|
|
|
|
|
Ok friends
Tanx for all your replies. You solved my problem. It's cool. I found many references in web about Repeater Control.
Regards
|
|
|
|
|
Hello,
I've a small question about designing my own component.
Well, I need to create a component, whose look like this:
http://www.danflash.com/files/dev/pm-tree.jpg
All items and subitems should be drag an dropable (with AJAX support) and should have an undefiend amount of levels...
Each item/subitem needs also a small icon on the lefthand-side of the text and an other icon (in this case a red flag) on the righthand-side.
How can I build such an object? The standard components from VS2005 aren't flexable enough and the whole component package from DevExpress, which I own, haven't any treelists or treeviews.
May, is a grid a good thing to start? Or which component (opensource or commercial) could you recommend?
Thank you,
sincerly
Danny Meier
|
|
|
|
|
Easy question most likely, but I don't know where to get started.
I need to build an HTML form dynamically based on the results of an SQL query I am doing so I can submit the form to paypal.
They need something in this format (this is from their example site):
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><br />
<input type="hidden" name="cmd" value="_cart"><br />
<input type="hidden" name="upload" value="1"><br />
<input type="hidden" name="business"<br />
value="seller@designerfotos.com"><br />
<input type="hidden" name="item_name_1"<br />
value="Item Name 1"><br />
<input type="hidden" name="amount_1" value="1.00"><br />
<input type="hidden" name="item_name_2"<br />
value="Item Name 2"><br />
<input type="hidden" name="amount_2" value="2.00"><br />
<input type="submit" value="PayPal"><br />
</form>
So I need to be able to insert that HTML onto my ASP page and then recursively add sections like this for each item returned from my SQL query.
<br />
<input type="hidden" name="item_name_1"<br />
value="Item Name 1"><br />
<input type="hidden" name="amount_1" value="1.00">
Alternately, if anyone knows of an easier way to submit a shopping cart to paypal from an ASP page I'd love to hear it.
Thanks
|
|
|
|
|
C# ASP is called ASP.NET. ASP is something else.
You can create a page which just has an asp:Literal control, and insert your HTML into that. But, I'm not sure if that helps, because that would generate a page to send to the client, is that what you want, or do you want to post it direct to paypal ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
I´ve got from a web services a soapexception an d i would like to get the real message from the web services: That is: _m"System.Web.Services.Protocols.SoapException: El servidor no puede procesar la solicitud. ---> System.Exception: aaa es un ceo \n en Service.Divide(Int32 a, Int32 b) en d:\\aaa\\Mis Documentos\\Visual Studio 2005\\WebSites\\WebSite2\\App_Code\\Service.cs:línea 25\n --- Fin del seguimiento de la pila de la excepción interna ---"
I would like to get the message: " aaa es un ceo \n"
|
|
|
|
|
Hi,
I am creating a user control in which datagrid/gridview is added.
This usercontrol is added to the page.
Data is provided to the datagrid from dataset/datatable in the page codebehind.
Everything is working fine except pageindexchanged event (in User Control), Since after the pageindexchanged event databinding is done which is presently done in page codebehind. In short i wanna assign data to the datagrid after the pageindexchanged event which is fired in user control.
How can i resolve such problem? Can help me out please?
Please revert in case of further clarification required.
Regards,
Anees
|
|
|
|
|
Data should always be assigned in the prerender event, as it fires after control events. The load event, always fires before.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian Graus for your reply, but may be i am not able to put up my question in the right way. So let me clear it out.
I am working on a project in which the user controls will be used as much as possible so that the end application developer will not have the problem to create the same control repetedly. Thats the reason we are creating DataGrid control in the User control so that the developer will just drag drop it and assign it the dataset/datatable from the BLL. Now the problem is Pagechange event is fired in the user control and the data is assigned in the BLL, so how can i call the BLL method in Pagechange event so that it can be fired in the user controls pagechange event after assigning the new page number. For e.g if i am not using user control then i can use the below code.
void PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
{
DataGrid grid = (DataGrid) sender;
grid.CurrentPageIndex = e.NewPageIndex;
// Bind data and refresh
grid.DataSource = ...;
grid.DataBind();
}
In my case the event is fired in the user control but the last 2 lines of assigning the datasource and binding the data is not done in the event it is done in the BLL.
Let me know if further clarification is required.
Thanks
|
|
|
|
|
Your control should set it's data source and databind in the prerender event. If it doesn't do this, if it's done higher up, and there's a good reason for this, then it should still work, so long as it's done in the prerender event, where it should be. If you are calling a proc that needs the page number, expose it as a property.
Beyond that, I don't see the issue. You're not showing the datasource code, so I don't konw if you need the page number to call it, but if you do, set a property. If you don't, if the control is handling paging, then it shouldn't matter, so long as you call after the event fires.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi every body
how can i put picture(logo) on the left of the URL as we see the logo of codeproject on the left of URL
Thaks in advance.
haitham
|
|
|
|
|
You need to have an .ico file in your web root named favicon.ico...
http://www.chami.com/tips/Internet/110599I.html[^] has the above method and also a second way of doing so...
I have checked method #2 on both IIS, Casini, and Apache web servers and they work nicely
|
|
|
|
|
Presently i have build a realestate webportal using ASP.NET with C#.
And Client requiremetn is : This webportal has to be appered in topten list while any user search for realestate sites in google.
Plz Help me how to do these.
thanks in Advance
|
|
|
|
|
This can be done if the real estate compnays pays some bugs of amount only.
If the real estate pays some bugs of amount to google we can bring it to first also.
Regards,
Satips.
|
|
|
|
|
|
Satips wrote: If the real estate pays some bugs of amount to google we can bring it to first also.
Absolutely Wrong
|
|
|
|
|
This is completely dependent on the content of your website. Google indexing mainly depends on these criteria s (Not a complete list)..
- Your site response time
- Good content
- Good meta information ( I think presently google won't care this )
- Friendly URL's
- Match with URL and content
Check your site in some textbrowsers. This is how the search engine spiders see your site. Check everything looks fine in textbrowsers. You can use LYNX text browser.
My suggestions are, search for any real estate websites, and look at the structure they have. And compare that with your's. You can get some good informations on some of SEO forums. Or try using google Adwords. But in that case you need to pay. But that also depends on the keywords you provide.
|
|
|
|
|
Thank u for u r valible information navaneeth
|
|
|
|
|
Hello!
I have a nice book on ASP.NET but it doesn't explain how to for instance transfer data like a string from one aspx file to another.
What I want to do is enter a string in Default.aspx and then pass that string to Default2.aspx, so that the string can be used in Default2.aspx.cs
I tried a lot of things, but they were all guesses.
Could someone give me some pointers?
Ranger.
Novice
|
|
|
|
|
|
Default.aspx.cs
protected void Button_Click(object sender, EventArgs e)
{
Context.Items["SourceLabel"] = SourceLabel.Text;
Server.Transfer("Default2.aspx");
}
Default2.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
TargetLabel.Text = (string)Context.Items["SourceLabel"];
}
This should work, but it doesn't. Did I forget something?
Ranger.
Novice.
|
|
|
|