|
Anyway, all question-related instructions aside, I think it's because of the runat="server" that your iframe isn't doing what it's supposed to do.
Hope this helps.
"My personality is not represented by my hometown."
|
|
|
|
|
Hi, Could you please tell me what is the usage of Interface? when we should use them. Could you please give me an example.
thx a lot
|
|
|
|
|
See, in real life, when you interact with some objects, you don't really care about the internal implementation or complexity of that object. For example, when you use your computer, all you care about is how to power on or off by switching the button, how to input data (Using keyboard or mouse) and as a user, you really don't care about how the computer is internally operating,taking your inputs and processing it to show output.
So, the computer has not exposed the internal complexities to you, or, to the outside world. All it provides is an "Interface" to the outside world with the information that the outside world needs to know to use and operate the computer. As a user, you are happy to know about the "Interface" only, rather then the Internal implementation and complexity (The "Class").
In the programming world also, when you need to develop a class (Which may do many complex things), you need to expose the capabilities and operation of the class to other applications or class libraries (That may use this class) so that they can understand and use your class accordingly. So, what you do is, you create an Interface that contains the method signatures and you implement those methods in your class. So, the client applications and libraries can develop their codes based upon the Interface you defined. While at runtime, the method invocation on the interface actually will turn out to method invocation in the implementation class.
Use of interface gives you extreme flexibility. For example, suppose you have an interface (IComputer) that exposes the functionality to the outside world and you have a class (WindowsPC) that implements the Interface method. Now, based upon some requirement, you can develop another class (MacPC) that implements the interface methods in a different way (Because, a MAC pc has the same kind of features, but, internally operates diffrently). Now, if the client application codes are developed based upon the Interface (And, not based upon the implementation classes), there is very little chance that, they would need to change their code. Why? Because, both of your implementation classes actually implements the same interface.
For example, WindowsPC and MacPC both implements the IComputer interface. So, if your client codes are developed using the IComputer interface and they accept the IComputer interface as parameters in their methods, you can send them an MacPC object, instead of the WindowsPC object any time and the client code will run perfectly without any problem (As long as your implementation classes are implemented correctly).
So, use of Interface gives you flexibility to your code that you can manage easily and you can extend it without much change.
Basically, use if interface is part of the basic Object Oriented Principles. You may take a look at this article How I explained OOD to my wife[^] to learn these principles.
Best of luck.
|
|
|
|
|
I marked it as a good answer but I think people asking these questions should do a Search for the same. These things are already explained at so many places. So if you do a search and read some articles/posts you will have a complete understanding of the topic. Just my opinion.
..Go Green..
|
|
|
|
|
Could you please do a Google search to find the answer for your homework/interview question?
..Go Green..
|
|
|
|
|
You are correct. Actually, it takes less amount of time to do a Google search rather than to post a question. The newbies often underestimate Google
|
|
|
|
|
Al-Farooque Shubho wrote: The newbies often underestimate Google
Even better than Google, something passed the trial of time, BOOKS
|
|
|
|
|
Watch some clips from Mehran Sahami (Stanford). He explains in this[^] video what an interface is (could also be lesson 9 or 11).
hope this helps
"My personality is not represented by my hometown."
|
|
|
|
|
Hello friends
i am conecting mysql in asp.net 2010 on vista but it junrate
error:-Unable to connect to any of the specified MySQL hosts.
Please help
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
That simply is not helpful.
1. check your mysql is in fact running
2. Check your connection string is correct
and check with this guy[^]
|
|
|
|
|
Hey,
i tried to save and show the image using asp.net. To save the image, i did
fleUpload.SaveAs(Server.MapPath("hint\\" + fleUpload.FileName));
and it worked perfectly fine.
But I am trying to show the image from that server and for that i did
Image1.ImageUrl = (Server.MapPath("hint\\" + fleUpload.FileName));
The problem is it is not throwing any error but it is not showing the image in the Image1 either. What can be the reason for this and how to get the image ?
suchita
|
|
|
|
|
The Server.MapPath() actually returns the physical location of a file based upon a relative path provided to it. So, while saving the image, use of Server.MapPath() is the correct way to obtain the physical path for saving the file.
But, while you have to display the file in the <asp:image> server control, you should assign a relative URL of the image to the Image1.ImageUrl property. Assuming that, you are storing the image under the "/hint" folder (Inside your web application root folder), you should write the following code for displaying the image:
Image1.ImageUrl = "~/hint/" + fileName
|
|
|
|
|
thanks a lot. Its working perfect.i did
Image1.ImageUrl = "~//hint//" + fileName
suchita
|
|
|
|
|
I have a ListView which is filled by generic list of type MyClass. I can easily bind data from this list into ListView. But I have problems with reading data in opposite direction. This is my class:
public class MyClass
{
public int id { get; set; }
public string name { get; set; }
}
I have also generic list of type MyClass:
List<MyTest> list = new List<MyTest>();
Finally I bind data to ListView this way:
ListView1.DataSource = list;
ListView1.DataBind();
My ListView template:
<asp:ListView runat="server" ID="ListView1">
<LayoutTemplate>
<table runat="server" id="table1" >
<tr runat="server" id="itemPlaceholder" ></tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr id="tr" runat="server">
<td id="td1" runat="server">
<asp:TextBox ID="tb1" runat="server" Text='<%#Eval("id") %>' />
</td>
<td id="td2" runat="server">
<asp:TextBox ID="tb2" runat="server" Text='<%#Eval("name") %>' />
</td>
</tr>
</ItemTemplate>
</asp:ListView>
How can I read data from ListView into my List list?
The operation of reading ListView data into List generic list should begin after clicking the button "GetData".
I saw the following advice:
List<MyClass> list = ListView1.Items
.Select(lvi=>lvi.DataItem as MyClass)
.ToList();
but it does not work - the DataItem property of each Item of ListView has null value.
The point is that I have generic list with data. I am binding this data into ListView which can be edited by user. After that after click Save or GetData data from ListView is read into generic list of MyClass type.
|
|
|
|
|
hi,
i have got 3 text boxes in my content page. on the press of enter key in textBox1 focus should be on textBox2 and there on press of enter key focus should be on textBox3. after pressing enter key there, button click event should be called.
please help me with some code
thanks in advance
regards,
dittu
|
|
|
|
|
Use javascript, here [^]is a good google search result for using KeyEvents with javascript.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hi,
When designing class how should understand, it implement as Static or public?
|
|
|
|
|
Hi,
You can confirm it from the class access modifier at class declaration part which displays under namespace node.
Rajendra Prasad Panchati
.Net/Sharepoint Software Enginner
Hyderabad.
|
|
|
|
|
This helps to explain it: Static Classes[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
If you understand Static class concept properly, then you will automatically come to know which method best suits your requirement. If the class is not specific to a particular instance or otherwise if you want some logic shared among all the users then you can go for static classes.
MSDN - Static Classes and Static Class Members[^]
|
|
|
|
|
Hi
Does anyone know where I can find examples and/or explanations on how to implement Structure Maps/Dependency Injection in C#? I have tried finding examples on the Internet, but what I found was not very good.
|
|
|
|
|
|
Yes, I already found that one too, but it doesn't go into the level of detail I want. I am looking for a worked example with explanation that I can use.
|
|
|
|
|
hi,
i tried to use check box in asp.net. well when i run the program, i checked the checkbox but when it process, it is taking checkbox as unchecked. Why this happens ? How to avoid this ?
suchita
|
|
|
|
|
You are surely doing something wrong.
Have a look here with lots of sample examples: CheckBox Class[^]
|
|
|
|