|
Look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Kindly avoid posting this kinda post in Programming forum. Might be you can try Lounge or so.
|
|
|
|
|
Hi Coders
I need to integrate paypal payment gateway in asp.net(C#). I want to use IPN method to get know the transactionId, payment status purpose.
I use sandbox account for this.I made the transaction successfully but it not give me IPN Message(querystring) which have complete detail like txn_id,status etc.I researched over it from last 3 days.
Do any provide a source code or sample application for this.
Thanks in advance
Amit
|
|
|
|
|
You should have searched the CP articles first. Check this[^] out.
|
|
|
|
|
|
Hello everyone,
I am trying to practice regarding OOP. I got a code from internet
public class StoreIndexViewModel
{
public int NumberOfGenres { get; set; }
public List<string> Genres { get; set; }
}
as I am beginner, I am trying to develop code in the way I learn.however it is not professional way.
this is my code regarding above code
namespace TestProject.ViewModels
{
public class StoreIndexViewModel
{
public int _numberofgenre;
public List<string> _genres;
public int Numberofgenre
{
set { _numberofgenre = value;}
get { return _numberofgenre; }
}
public List<string> Genre
{
set { _genres = value; }
get { return _genres;}
}
public StoreIndexViewModel(int numberofgenre,List<string> genre)
{
this._numberofgenre = numberofgenre;
this._genres = genre;
}
Could you please tell me did I write correct code?
thx for your help.
modified on Saturday, August 28, 2010 8:00 AM
|
|
|
|
|
future3839 wrote: Could you please tell me did I write correct code?
Correct in what sense? If it compiles, it is syntactically correct. You can check that yourself. If it does what you want it to do, it is logically correct, may not be the best/optimum logic though.
I think you should describe what do you mean by correct.
Anyways, here are a few things that you may consider:
1. If you are using .Net 3.0 or above, make use of automatic properties.
2. You can make use of XML comments and regions in stead of commenting using "//".
3. You can make your fields private and have them only when it is really needed.
4. No need of having "this" keyword unless really needed.
5. Make use of Generic lists or Collection since they are strongly typed.
modified on Saturday, August 28, 2010 11:14 AM
|
|
|
|
|
future3839 wrote: //definition of Fields
public int _numberofgenre;
public List _genres;
Your field definition need to be private . You have public accessors.
|
|
|
|
|
In addition to the other comments you should use the properties rather than access the fields directly
this._numberofgenre = numberofgenre;
Should be
Numberofgenree = numberofgenre;
This way any logic that needs to be executed when a property is accessed will not be by-passed. Also, if the backing field changes it will not affect the code.
Most coding standards also dictate the use of Pascal casing for properties and methods
Numberofgenre => NumberOfGenre
Many also prefer fields to begin with m_
public int _numberofgenre; => public int m_NumberofGenre;
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I am just trying to learn JQuery.
I want to try out a basic JQuery example. Adding items from one list box to another.
It works fine in the normal aspx page (I pasted it in Default.aspx in root directory).
I placed JQuery Libraries in a folder Javascript under root.
This works fine.
Then I created a WebUserControl and placed the same code and I registerd this user control in default.aspx.
The page loads , but when I click on Add it does not move items from one list to another.
While in the aspx page, I checked the Watch and
innerHTML of the context->childNodes has values "Delhi, Bombai ..........". Same as OuterHTML.
But in the user control with the same code as pasted below.
innerHTML is "" and OuterHTML is "<HTML4F>"
Please throw some light to this
See the code below:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="User_Controls_WebUserControl" %>
<script src="../Javascript/jquery-1.4.1.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
debugger;
$("#add").click(function () {
debugger;
$("#fromListBox option:selected").appendTo("#toListBox");
});
$("#addAll").click(function () {
$("#fromListBox option").appendTo("#toListBox");
});
$("#remove").click(function () {
$("#toListBox option:selected").appendTo("#fromListBox");
});
$("#removeAll").click(function () {
$("#toListBox option").appendTo("#fromListBox");
});
});
</script>
<table>
<tr>
<td><asp:ListBox ID="fromListBox" runat="server" SelectionMode="Multiple" Rows="6">
<asp:ListItem>Delhi</asp:ListItem>
<asp:ListItem>Chennai</asp:ListItem>
<asp:ListItem>Pune</asp:ListItem>
<asp:ListItem>Kolkata</asp:ListItem>
<asp:ListItem>Mumbai</asp:ListItem>
<asp:ListItem>Bangalore</asp:ListItem>
</asp:ListBox></td>
<td> <input id="add" type="button" value="Add" /><br/>
<input id="addAll" type="button" value="Add All" /><br/>
<input id="remove" type="button" value="Remove" /><br/>
<input id="removeAll"type="button" value="Remove All" /><br/></td>
<td><asp:ListBox ID="toListBox" runat="server" SelectionMode="Multiple" Rows="6"></asp:ListBox> </td>
</tr>
</table>
modified on Saturday, August 28, 2010 6:03 AM
|
|
|
|
|
afsal qureshi wrote:
Are you sure there is no changes in javascript script file path after moving your code to user control ?
|
|
|
|
|
I don't think so. I picked up the Src value from the source selector popup.
For Clarification,
JQuery-1.4.1.js resides in stays in Javascript folder in root.
User Control stays in User Control folder and default page stays in the test folder.
Also if path is inorrect we would have got a javacript runitime error
modified on Saturday, August 28, 2010 1:33 PM
|
|
|
|
|
Have you checked the ids that are being rendered are the same you are looking for? Remember the name mangling that ASP.NET applies.
You can check it like this
$("select[id$='fromListBox'])
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi,
im developing a webapplication where i dont want to have a minimize and maximize buttons of the startup page.and i also dont want the menu bar also.
it is urgent requirement for me.
thanks in advance.
|
|
|
|
|
vishnukamath wrote: im developing a webapplication where i dont want to have a minimize and maximize buttons of the startup page.and i also dont want the menu bar also.
Your question is not clear. What do you mean by startup page ? About which menu bar you are talking about ?
vishnukamath wrote: it is urgent requirement for me.
First of all be specific with your requirments and represent it well so that any one can understand and give you answer as quick as possible. Other wise it would be quite difficult to answer.
|
|
|
|
|
hi,
im designing a login page,when i run my application it is the first page that will appear on screen.
now i have a requirement that my login page should not have the menubar(file,edit,view,etc..) and the minimize and maximize buttons should not work.
this is an urgent requirement.hope you understand.
thanks in advance.
|
|
|
|
|
|
hi,
i tried with window.open
and if i use window.open the result will be another window opening, but i need to display my login window without menubar and maximize and minimize buttons.please suggest me better way to do this.
thanks and regards,
vishnu.
|
|
|
|
|
|
in my project i had a gridview and in the gridview ihad a templatefeild in which i had a file upload control and a button control. while clicking on button the fileupload control should read the filename. but we are getting the null value for filename.
any suggestions plz............
thanks in advance............
|
|
|
|
|
Are you doing it on the client side (using JavaScript) or on the server side (doing a postback on button click)?
Can you give the code that you used, without which it would be difficult to identify the issue?
..Go Green..
|
|
|
|
|
vishnukamath wrote: while clicking on button the fileupload control should read the filename. but we are getting the null value for filename.
Where is your source code ? have you checked with FileUpload1.PostedFile.FileName ? And also make sure you are check the Postback option !
Let me know if the problem is still there.
Thanks !
|
|
|
|
|
hi,
My issue fixed and thank you for your suggestions.
Thanks & Regards,
Vishnu.
|
|
|
|
|
Hi All
I have byte arrry which is saved into the data base we converted text to byte array using Itextsharp dll but when i getting this byte array from the data base how to convert it into the text format
I have already tried the below following way.
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
return enc.GetString(input);
also tried
System.IO.MemoryStream memo = new System.IO.MemoryStream(pdfByteArray);
System.IO.StreamReader reader = new System.IO.StreamReader(memo);
string text = reader.ReadToEnd();
can u guys suggest another way to do this.
Thanks
amit patel
|
|
|
|
|
Did you triede Convert.ToBase64String ?
|
|
|
|