How To Get A Code Review Of Simple Gallery Method
Jun 29, 2010
I wanted to get a code review of my methods for creating a simple list/gallery display in ASP.NET. I am looking for specific ideas on how I might approach this same task differently. My goals are simplicity, rapid development, and ease-of-use.
The task: Create a simple image list view (gallery) for a folder in ASP.NET web forms.
How I Did It: I created the image controls on the fly and add them to a placeholder template. I added line breaks using literals controls too. Finally, I add a query string to the page for the "paging".
What other ways would one recommend to do this? I had considered to use a grid or listview. My goal was to do this really quickly.
View 1 Replies
Similar Messages:
Feb 9, 2010
I am using the SQLDataReader to execute a Stored Procedure that accepts two parameters (BuildingTID and Department) to return the appropritae Value in my case The Director of the Department. My problem is I get the following error when I run the code that I added below for review. Let me also add that the user is selecting the values that I am using for the stored procedure from 2 DropDownLists. I am getting it when I try to assign the value that is in the Department DropDown
list to the first parameter.
Dim myParm As SqlParameter = getDirectorsCMD.Parameters.Add("@BuildingTID", SqlDbType.Int, 15).Value = (ddlDepartment.SelectedValue)
Also obviously there are more issues with my code than just the error because the datareader records property is false meaning I am not returning a row
View 12 Replies
Dec 2, 2010
Boss comes in and demands that we change an existing dataload process written in .Net 2.0 to call stored procedures on two different servers rather than just one. In his mind (not a programmer) this should be a short overnight process. We have about 60 different SQL Commands that we need to change and test. Is there a simple way to do this that I can't think of? If there isn't we will use something like replication or database mirroring, which is my preference but is likely to get the cold shoulder from my boss, especially since I have never set these up before. A function that takes a SQLCommand as its argument and then iterates through as set of connections to execute the SQLCommand. Change all stored procs to call the same stored proc on a linked server.
View 1 Replies
May 12, 2010
I want execute below callback() method after completion of document.getElementById('btnDownload').click(); method . Now callback()executing immediatly. I want wait "Click()" process done then Execute callback(); method.
function LoadPopup() {
// find the popup behavior
this._popup = $find('mdlPopup');
// show the popup
this._popup.show();
// synchronously run the server side validation ...
document.getElementById('btnDownload').click();
callback();
}
function callback() {
this._popup = $find('mdlPopup');
// hide the popup
this._popup.hide();
alert("hi");
}
View 2 Replies
May 11, 2010
how to code a simple calculator in ASP.NET? Everything I try isn't working...Here's what I need to do:
Create a web page with a simple calculator. The web page will have two text boxes (with labels) for data entry, radio list box to select the operation (+, -, *, and /), label to display the result, a calculate button and clear button. Use Validation controls to validate the data entry. Write the code using try/catch block to catch any data entry error. If there is any data entry error then display the message in the result label. Create an appropriate header for the web page and add graphics to make the page look professional. Set the default focus of the form to the first text box and default button to calculate button.
View 4 Replies
Jun 23, 2010
I'm new to ASP.NET, and I'm trying to get started with a simple tutorial. But I'm having problems configuring the ability to actually display a .asp or .aspx file on my computer. I have .NET 4 on the computer I'm attempting the following code:
[Code]....
I get an error on my browser that there is an error, and it doesn't display the time as of now.
View 2 Replies
Jan 25, 2011
I have a web method in my code behind:
[System.Web.Services.WebMethod]
public static string GetStateData(string state)
{
//this is where i want to call a javascript method "GetItems"
}
I have a javascript method that retrieves some values for me and I want to get use one of those values in my web method
function GetItems() {
var variable1= $("#<%=Item1.ClientID %> input:checked");
var variable2= $("#<%=Item2.ClientID %>").val();
return [variable1.text(), variable2.val(), variable2];}
I've searched for ways to call the javascript method from the web method but every time my search results in how to call a web method from javascript.
I did find this but it was done from the code-behind of a silverlight project and when I tried adding the correct reference to my code-behind it wasn't there
var result = HtmlPage.Window.Invoke("GetItems"); Is there a reference I'm missing?
View 2 Replies
Mar 23, 2011
I'm going thru an asp.net 4 book, and I'm at a part about classes and their properties and functions. But up to now, all the examples involve a web_site, with controls, code_behind files, CSS, etc. But, I get to places where I don't understand the examples, so I look out on the web for other resources. For example, I found the code below to demonstrate the "ToString" function. My problem is, I'm not sure know how to test a little piece of code like this. Can't I just open up an application or project or something, paste this in and run it?
Module Module1
Class Perl
Dim _a As Integer
Dim _b As Integer
Public Sub New(ByVal a As Integer, ByVal b As Integer)
_a = a
_b = b
End Sub
Public Overrides Function ToString() As String
Return String.Format("[{0}, {1}]", _a, _b)
End Function
End Class
Sub Main()
Dim p As Perl = New Perl(2, 3)
Console.WriteLine(p)
End Sub
End Module
View 2 Replies
Jan 25, 2011
I am new to the Web Services. I am learning this one. I am 10th stander. I need a simple code and procedure how to use it in our web site?
View 2 Replies
Jul 15, 2010
Is there any documentation or tutorials anywhere on what can be done or put between these magical symbols in ASP.NET aspx files? I've tried a number of resources though they all seem aimed at Classic ASP.I'm already writing protected functions for updating and grouping in my grids using Eval. But, for example, I noticed the following in my code :-
ConnectionString="<%$ ConnectionStrings:WORK_MyConnectionString %>"
I presume that $ ConnectionStrings is a macro or built-in function of some sort and I'm trying to track down what else is available in this area. I would also like to use the
<% if (my function) then .....endif %>
to conditionally write items to the page.
View 5 Replies
Jun 5, 2010
I need to pass a value from the selected button in user control to the containing page. I have it working fine but only by using a bunch of if statements that strike me as ugly. Can't figure out how to use a switch statement which, I think, would be a bit less cumbersome. I'd welcome on how to clean up this code (obviously I'm new to delegates).
Here's the code:
User Control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DelegateUserControl.ascx.cs"
Inherits="Foobar.UserControls.DelegateUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button 1" onclick="Button_Click" />
<asp:Button ID="Button2" runat="server" Text="Button 2" onclick="Button_Click" />
<asp:Button ID="Button3" runat="server" Text="Button 3" onclick="Button_Click" />
User Control code behind:
using System;
namespace Foobar.UserControls
{
public delegate void SendButtonValueToPage(int buttonValue);
public partial class DelegateUserControl : System.Web.UI.UserControl
{
public static event SendButtonValueToPage SendButtonIdToPage;
[Code]....
View 6 Replies
Aug 8, 2010
.net frame work. I know about few controlin .net and I have tried few programs also. Now want to learn a databaseconnection in .net so please provide me one easy example of such program.
View 2 Replies
Oct 23, 2010
someone with good recursion understanding can do it but i failfor example i have a datatable with following data
ID ------------------- Name ------------------- ParentID
1 ------------------- Home ------------------- null
2 ------------------- Course ------------------- null
3 ------------------- .Net ------------------- 2
[code]...
View 2 Replies
Jan 13, 2011
I have added jquery gallery image plugin to my web site AD-Gallery
But the lower arrow buttons are not working both in IE and FF. When I moved the mouse over any one of it , an error box appeared in IE with this text
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Thu, 13 Jan 2011 22:39:31 UTC
Message: Object doesn't support this property or method
Line: 439
Char: 15
Code: 0
[URL]
And the code at line 439 in jquery.ad-gallery.js file is :
var left = context.thumbs_wrapper.scrollLeft() + 1;
why I'm getting this error and how can I get rid from this?
View 2 Replies
Aug 2, 2010
Here is my situation. I have inherited an MVC 2 application. I am learning MVC 2 on the fly with this application. I am trying to validate a checkbox by doing this: Grey out the submit button until the user clicks on the "checkbox" then the submit button is enabled. 1st question: Where do I place the code to make this happen? 2nd Question: How do I go about doing what I explained? I wanted to use a simple javascript code within the click event of the checkbox but I don't see this in MVC 2.
View 4 Replies
May 29, 2010
I am trying to find a very simple code that allow users to login and logout using C# asp.net 2008.
I used to compare the cookies with session ID, it worked fine but I could not find a way so the user can logout.
View 3 Replies
May 18, 2010
how do you call code behind button click event or a code behind method
from javascript.
View 8 Replies
Apr 28, 2010
i want to retrieve the image from image gallery. and then i want to insert it and store in image gallery.
View 2 Replies
Jul 12, 2010
I want to design it in windows application form of Visual Stdio 2008
View 2 Replies
Jul 21, 2010
I need display navigation in my website with ASP.NET 4 components. Navigation use XmlSiteMapProvider and file hierarchy as XML file. Because my website is a CMS I am looking for a solution able to store hierarchy in DataBase or in some sort of Business Logic. I found out SQL Site Map Provider, which seems a workaround to store hierarchy in SQL. [URL]
View 1 Replies
Mar 15, 2010
Is this piece of code where I lock a part of the function correct? Or can it have use drawbacks when multiple sessions ask concurrently for the same Exam? Purpose is that client that first asks for the Exam will assemble it, all next clients will get the cached version.
public Exam GetExamByExamDto(ExamDTO examDto, int languageId)
{
Log.Warn("GetExamByExamDto");
lock (LockString)
{
if (!ContainsExam(examDto.id, languageId))
{
Log.Warn("Assembling ExamDto");
var examAssembler = new ExamAssembler();
var exam = examAssembler.createExam(examDto);
if (AddToCache(exam))
{
_examDictionary.Add(examDto.id + "_" + languageId, exam);
}
Log.Warn("Returning non cached ExamDto");
return exam;
}
}
Log.Warn("Returning cached ExamDto");
return _examDictionary[examDto.id + "_" + languageId];
}
I have a feeling that this isn't the way to do it.
View 4 Replies
Dec 29, 2010
I work on a intranet site of management review,to insert the markes I have files for each module.I want only the
professor of module has the rightaccess to his file.How ?
View 1 Replies
Sep 24, 2010
I added the extender and when i tried to add the method this message poped up; Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.
View 4 Replies
Oct 20, 2010
I can place an Excel file in the root directory, use Browse and view an xlsx, xlsm or any other Excel file and it (sometimes) pops up in a browser window with no option to save or do anything other than view the Excel document (you can type in the cells and it gives you the option to save if there are any changes). I'm trying to find out how to do that exact thing client-side.
We have a server that allows a client to upload an Excel file and we want them to be able to review it only. If there is a way to bypass the Open message box that pops, that would be ideal, but just getting it to display in a separate, small browser window would be just what the doctor ordered. The Excel files are varied so the content is always different and not necessarily formatted the same. That removes the ability to go with named ranges and definitions.
Currently with the code we have, users can press a view button to review the file they uploaded for errors but it opens up the full version of Excel and then throws errors because it tries to force a save to a temp file. Not exactly ideal and very confusing to the user. I don't habve the exact code available to me at the moment, but I'm hoping that someone can point me in the right direction.
View 1 Replies
Jul 29, 2010
I'm constructing a new cms with the option to create reviews and articles (blog items). Now if the user wants to write a review he/ she will want to add a lot of images in the text. Now my question to you is , what would be the best option to include those images (with keeping in mind that a CDN can be used later). I was thinking of the following methods:
Break an article in multiple blocks, each block can then include a picture and text. Just add the picture in the text via WYSIWYG editor (easiest option but not so versatile) Upload images separately and include them via tags in article text. Like Title{img_1}Content
View 2 Replies