|
Hi,
I am trying to use an External Web Service in my Web Site application i am developing. The problem occurs when declaring the namespace such as this:
using namespace.classname
Error: The type or namespace cannot be found.
Does this mean i have to put the C# class file into App_Code folder?
I was wondering if somebody could help me please in terms of replicating the problem i am facing? I am trying to use the following web service:
IMDB Web Service
I have followed the instructions but it still doesnt work. I have even copied the following code from the generated output file which you will see when you access the above URL into my global WebConfig file and it still doesnt work.
I am using .NET Framework 3.5 and VS 2008.
Thanks & Regards,
|
|
|
|
|
Hi I am using a gridview to display data from my table at runtime. I am new to ASP.NET.
I am not using boundfields but I am using Template fields. I specify the HeaderText and DataKeys
I am using a web service to provide me a DataSet of the chosen table and bind it to the GridView in page_load event.
I would like to count the number of records from a chosen table and display that in the Gridview.
I have written a method to return number of records by passing in a string parameter product name
but i am not sure of how to invoke the method so the value is shown in the GridView.
How could i go about doing this?
Do i need to invoke the method using Eval like this:
<asp:TemplateField HeaderText="ProductName" SortExpression="ProductName">
<ItemTemplate>
<%#GetRowCount(Eval(ProductName))%>
</ItemTemplate>
</asp:TemplateField>
Would the above work?
Thanks,
|
|
|
|
|
Why to hit performance(and extra code!) so much when you can get the same information in the dataset of gridview along with other data?
Using webservice when you are getting data, also retrieve the count of rows in it.
Or, if you cannot do that, then before using it as a source to grid, append the count of rows to dataset and use the modified dataset as datasource of your grid. You are all set!
|
|
|
|
|
Can you provide me an example please if you dont mind?
Thanks,
|
|
|
|
|
Hi.
I have this updatepanel, with some fields that are getting filled from an ObjectDataSource.
One of the fiels are a date, and i want this date to be marked as red (and maybe in bold) if the date is one day from today or later.
Problem is, I have no clue on how to do this, since I am new to asp.net!
So is there a way to add a method that changes this specific ItemStyle-ForeColor based on the content i get from my datalayer?
This is my updatepanel:
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView Width="1200" ID="gvTasks" runat="server" OnRowCreated="gvTasks_RowCreated"
DataSourceID="odsTaskList" GridLines="None" AutoGenerateColumns="false" CssClass="mGrid"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" OnSelectedIndexChanged="GvTasks_SelectedIndexChanged"
DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="Enddate2" HeaderText="Enddate" ItemStyle-ForeColor=RED-IF-OVERDUE-EXCEEDED ItemStyle-HorizontalAlign=Center>
<HeaderStyle Width="80px" HorizontalAlign="Center" />
<asp:BoundField>
<Columns>
<asp:GridView>
<ContentTemplate>
<asp:UpdatePanel>
Thanks alot!
|
|
|
|
|
lvq684 wrote: I have this updatepanel
It does not matter in your case.
lvq684 wrote: i want this date to be marked as red (and maybe in bold) if the date is one day from today or later
You need to use RowDataBound of GridView for this.
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
DataControlRowType rtype = e.Row.RowType;
if (rtype == DataControlRowType.DataRow && rtype != DataControlRowType.Footer
&& rtype != DataControlRowType.Separator && rtype != DataControlRowType.Header
&& rtype != DataControlRowType.Pager)
{
Calendar cd = e.Row.FindControl("myCal") as Calendar;
cd.ForeColor = Color.Red;
}
}
|
|
|
|
|
Thanks alot for your answer, but I dont quite follow the code.
Whats up with the
Calendar cd = e.Row.FindControl("myCal") as Calendar;
And could you please paste the corresponding .aspx code for the Gridview please?
I am very grateful!
|
|
|
|
|
I believe what i have provided is more than enough.
lvq684 wrote: could you please paste the corresponding .aspx code
No! i wouldn't
lvq684 wrote: but I dont quite follow the code
You said you have a calendar inside the grid, so that line gets the calendar control to you.
Looks like you are a fresher. Would suggest you to read book first.
|
|
|
|
|
Yes, as stated in the first post, I am new to asp.net.
It´s not a calendar but a simple string which holds the date. The date sorting is being issued elsewhere. But I´ll try changing the calendar to a string and fiddle with it.
Question is just how the page control calls this method. I will google some more.
Thanks.
|
|
|
|
|
hi, iam using asp.net with c#,
in my page there are many images in top ,left , right,bottom i want to draw verticle line and horizontal lines like this as showed in below example .can you give example which helps me
||
image1 || || image9
|| ||
|| ||
image2 || || image9
|| ||
|| ||
|| ||
image3 || || image10
|| ||
||====================================||
image4 image5 image6 image7 image8
|
|
|
|
|
|
|
Hello all!
I'm new to asp.net and i'm trying to bind some XML data to a gridview.
abviously I'm not understanding how to do it properly because that my code doesn't seem to
work...Can anyone could help me please?
this is my xml:
#########################################
<?xml version "1.0" encoding "utf-8"?>
<dictionary>
<item>
<key>
<string> hello world </string>
</key>
<value> <anytype xmlns:q1="http://www.w3.org/2001/XMLSchame" d4p1:type="q1:int"
xmlns:d4p1="http-instance">45</anytype>
</value>
</item>
</dictionary>
and this is my code:
########################################
string path = "D:\\myXmlFile.xml";
DataSet oDs = new DataSet();
oDs.ReadXml(path);
GridView1.DataSource = oDs;
GridView1.DataBind();
thanks
Tom
|
|
|
|
|
|
There are a lot more forums left. Why not post your question in all of them.
|
|
|
|
|
Hello,
I am looking for a good design pattern that will solve managing Urls in a web application. At this moment, I have a chaos of hard coded url referring in every pages. If I change the page name, I get lost as I dont know how many pages I have to update where I used the url. So, I am assuming, there should be a pattern something named URL Factory etc. Cany you please give me a guidance... !
Another question, does it make any difference in performance if I use absolute URL instead of relative url ? I am thinking of developing a URL factory for my web application and so, if I use Absolute url, it may be easy to manintain my Url factory.
Regards.
|
|
|
|
|
There is no pattern for this, although, the MVC pattern may be able to help since urls are based on actions not actual page names. The application should be sufficiently designed so you are not continuously changing file names.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
Thanks for your reply. I know that MVC solve this problem, but I actually do not like MVC as I am so much fond of event based programming, moreover, I have already developed a complicated ASP.NET Application based on Web Form, so maybe Model View Presenter would be a solution for this. Can you tell me if there is any standard Model View Presenter framework available for Web Forms ?
|
|
|
|
|
Emran Hussain wrote: I actually do not like MVC as I am so much fond of event based programming
It's not a case of whether you like it or not, or whether you are fond of it or not. The best tools for the work should be the deciding factor. Many projects have failed miserably because managers, architects and developers having only used what they are most familiar with or most comfortable with, not the best solution for the problem.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Every1,
I have webpage which displays an article and at the end of the same i have a print buttn (Asp:ImageButton).When i click on it ,i want to open a new window with article on it and a print dialogue box for printing..How can i acheive this...
Thanks in Advance,
|
|
|
|
|
I don't understand your question but, if you want to open a new window on image click then
Use ImageButton 'onClientClick' Event.
like
onClientClick="window.open(your page url);"
|
|
|
|
|
|
window.open opens link[^]a new window and window.print link[^] will print your article. It will show the print dialog first.
|
|
|
|
|
Hi,
I Want to Convert my whole site to Hindi...I have two links as Hindi and English...If i click the link as Hindi the whole site should be converted to Hindi and if i click the link as English then the whole site should be changed to English, same as that of this site "http://www.univercell.in/mobiles/populateStore.action". Plz do the needful
Regards,
Kavitha
|
|
|
|
|
No need to post it multiple times. Stick to one and follow it. Remove the other one you had posted before anyone replies to it.
|
|
|
|