|
I would be inclined to create a suitable control on the form and then populate it from code behind. That way you can render the control with any styles, etc, ready to accept the value. Perhaps like:
<asp:Label ID="Label1" runat="server" CssClass="bold fancyfont veryverybigsize" />
In the OnLoad event (or wherever you deem appropriate):
if (!IsPostBack)
{
result = GetStringValueFromDatabase(Parameter);
Label1.Text = result;
}
or similar.,
"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
|
|
|
|
|
It really is up to you. You can use a grid view, a datalist, textboxes, labels, etc. It all depends.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
ye, i know... i need to develop master page for portal that has content like this:
////////////////////////////
//div
//
//Check our latest product!
////////////////////////////
////////////////////////////
//div
//
//Pool: What do you think?
//1.
//2.
//3.
////////////////////////////
////////////////////////////
//div
//
//TOP 1 video
////////////////////////////
////////////////////////////
//div
//
//Latest client activites
////////////////////////////
...many more
so i have plenty of "single record" DataSources (queries like "select something from myTable where id=1")
the way i did this is:
////////////////////////////
//div
//
//<asp:repeater datasourceid="productSds">
////////////////////////////
////////////////////////////
//div
//
//<asp:repeater datasourceid="poolSds">
////////////////////////////
////////////////////////////
//div
//
//<asp:repeater datasourceid="videoSds">
////////////////////////////
////////////////////////////
//div
//
//<asp:repeater datasourceid="activitiesSds">
////////////////////////////
but using x repeaters for x "single record" DataSoruces feels wrong. so i am just wondering is this approach ok?
|
|
|
|
|
It isn't wrong because it allows for future flexibility but you may want to create a user control for each of those items and just use labels and textboxes or whatever you want in the control. Then just add as many of the usercontrols onto your page. That may make management of it easier.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
guys;
I have a problem with creating an AutoCompleteExtender dynamically using javascript.
I wrote the below code but it didn't work when I added the text box (txtTaget) to the page.
var txtTaget = toElement('<input type="text" />');
var extender = $create(
Sys.Extended.UI.AutoCompleteBehavior, {
"completionListCssClass":"autocomplete_completionListElement",
"completionListItemCssClass":"autocomplete_listItem",
"delimiterCharacters":"",
"highlightedItemCssClass":"autocomplete_highlightedListItem",
"id": GetUniqueID(),
"minimumPrefixLength":2,
"serviceMethod":"MyService",
"servicePath":"/root/servicepath.aspx"
},
null,
null,
txtTaget
);
Help people,so poeple can help you.
|
|
|
|
|
Hey guys,
I want to create an online chat/customer service section for my asp.net website, I have looked around and just found some old projects (visual studio 2003)
I want to create it with .net 4.0, I'm looking for some tips and tutorials or resources I can use.
Thanx in advance
K1
|
|
|
|
|
Hi all,
I am working on creating a Wizard in asp .net, The user can access the different screens of the wizard and enter data. I want to handle this huge data, either in memory or can also save it to the database when navigated from the screen.
I would like to know what would be the various ways to do the above.
Thanks,
Pramod
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
It really depends on what you are going to be doing with the data, and the layout of your wizard.
Are you going to be doing calculations with the data (or using it to create the next part of the wizard dynamically), or are you just needing to store it for retrival later?
Are you using the ASP Wizard Control (that keeps everything on the same page), or are you using a custom designed wizard?
Answers to these questions will help better determine the optimal way to store the data.
|
|
|
|
|
I am trying to call a calender popup using custom controls which is not working
What i did
I download calender plugin shown below and run in my webpage - worked
(http://jqueryui.com/demos/datepicker/#icon-trigger)
I replaced the calendar JS and CSS files to dll - NOT WORKED
I added a Sample js and css file in the DLL and called that js and css - WORKED
Why the calender JS and css not worked?
Trials that i did
-----------------------
Changed the property to Embedded resource
Removed the DOTS from the Jquery JS files
This is the way i am calling the css:
string cssDatePickerURL = Page.ClientScript.GetWebResourceUrl(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.datepicker.css");
HtmlLink cssDatePicker = new HtmlLink();
cssDatePicker.Href = cssDatePickerURL;
cssDatePicker.Attributes.Add("rel", "stylesheet");
this.Page.Header.Controls.Add(cssDatePicker);
This is the way i am calling the JS:
cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery-1.7.1.min.js");
cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.core.js");
cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.datepicker.js");
|
|
|
|
|
CSS files are taken but Java scripts are not.
In Fire Bug , HTML tag shows tag. There are 9 link tag each for my
CSS and Js files. In those CSS links are showing data properly but JS data
is showing as below :
<title>The resource cannot be found.</title>
<body bgcolor="white">
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /WebResource.axd
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
</body>
Moreover, there is Firebug tab name CSS.
In that there is a dropdown which shows 9 webresource.axd?sfsdfsdfsdcsksdfkhskdf values where each describes the js and css files embedded as resource.
in those CSS resources are look fine, but for js nothing is visible and a blank page comes in the firebug console while i click
I have found following following trials to fix this issue : But no hope
Added [assembly: WebResource("MyNamespace.MyScriptFile.js", "text/javascript")] above the class's namespace declaration.
Script file has build action "Embedded Resource".
Tried registering during OnInit, OnLoad and OnPreRender
Script file is in the same assembly and namespace as the control registering it its work fine.
Does not work using any of the following methods:
ScriptManager.RegisterClientScriptResource(Page, GetType(), "MyNamespace.MyScriptFile.js");
Page.ClientScript.RegisterClientScriptResource(GetType(), "MyNamespace.MyScriptFile.js");
Try implementing my own ScriptManger and then adding the embedded file from there. Here's an example
public class MyScriptManager : System.Web.UI.ScriptManager
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
RegisterClientScriptResource(this, typeof(ScriptManagerExtension), "MyNamespace.MyScriptFile.js");
}
typeof(WebDate)
[assembly: WebResource("Library.Resources.Scripts.libscript.js", "text/javascript", PerformSubstitution = true)]
Changed the order of js files
.BaseType
typeof(Company.Product.Web.Library.Class1)
Created Different solution for dll
Please help any other alternatives available?
|
|
|
|
|
i have table sutudent and student marks
i had button to search by reg.no and get all marks of this reg. in gridview ,it is work but i have problem when i press edit or any command of gridview then this grid disappear and press button it appears and work command which i pressed
pleas help me how i can press any command of gridview without disappear
|
|
|
|
|
Hi,
You need to show you code what you done before and where you are stuck.
Maulik Dusara
Sr. Sofware Engineer
I love it when a plan comes together
|
|
|
|
|
Give your code sample to get answer mate
|
|
|
|
|
Hi friends i am new to .net in my interview my interviwer asked the question how to retrieve the data from .txt file to asp.net ..please give me suggestion..waiting for ur valuable replies...
sravan
|
|
|
|
|
There are various ways to import data from textfile in SQL Table.
Check this link for more info[^]
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
sravan1107 wrote: data from .txt file to asp.net
Hi,
you can do it using ado.net, it is as similar as we are doing connection with any database or database server.
You just need to use such Connection String
Maulik Dusara
Sr. Sofware Engineer
I love it when a plan comes together
|
|
|
|
|
sravan1107 wrote: How to retrieve data from .txt file to sql server
sravan1107 wrote: how to retrieve the data from .txt file to asp.net
They are two different things. What was the exact requirement?
V.
|
|
|
|
|
hi,
i have a report that shows Monthly attendace of employee..
Each day has 2 or more than two entries for a employee , 1 when he signin and the other when he leaves
i have to use Group by Days like this,
Note:
INOUT 1 = TimeIN
INOUT 2 = TimeOut
TID ATTENDANCEDATE EMPID INOUT
01 nov 2010
37219 2010-11-01 09:01:00.000 0000000001 1
37109 2010-11-01 18:02:00.000 0000000001 2
02 nov 2010
37219 2010-11-01 09:01:00.000 0000000001 1
37109 2010-11-01 18:02:00.000 0000000001 2
37219 2010-11-01 09:01:00.000 0000000001 1
03 nov 2010
37219 2010-11-01 09:01:00.000 0000000001 1
37109 2010-11-01 18:02:00.000 0000000001 2
i have use =Fields!AttendanceDate.Value in Parent Group and Included Group Header
The Problem is the report is only showing 1 record in each group..
please tell me how i can do this?
|
|
|
|
|
You should format your date column as dd.MM.yyyy or in any another format, in this format which you have now there is included too hours, seconds and miliseconds.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I am trying to call a css class through code behind.But its not working.I would like to know why it is not working.first i created a dd.css and put it inside the web.solution its worked perfectly.Next i created a class library and put code to call css and used that dll in the web solution.that is NOT working. i want to know why?
Here is my code :
string cssResourceURL = Page.ClientScript.GetWebResourceUrl(typeof(WebDatePicker), "Infotech3i.TSG.WebControls.WebDate.dd.css");
HtmlLink cssLink = new HtmlLink();
cssLink.Href = cssResourceURL;
cssLink.Attributes.Add("rel", "stylesheet");
this.Page.Header.Controls.Add(cssLink);
this.CssClass = "tb3";
This the html :
<tsg:WebDate ID="WebDate1" runat="server"> </tsg:WebDate>
</form>
Here is the generated HTML source which is working and NOT working attached
Working
<head id="Head1"><link rel="stylesheet" href="Styles/dd.css" /><title>
title
</title><link href="/WebResource.axd?d=iC4Q3hnnzmFTp7YCqAYyJWRLxXvVCu0imrwleh5pLZzSjMz5ffNwRIAfGpCdNN-j48DCo-EXF8tOqbycGLUPiCh0DedzEXS6K2hGXpTKYLo1&t=634669004307886419" rel="stylesheet" /></head>
<body>
<form method="post" action="WebForm3.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTA1MDMzMTA3MGRkl6qKWIrshH+aigDshOc8BgPqaH4BE4nMNFfQ4LFTfOk=" />
</div>
Not working
<head id="Head1"><title>
title
</title><link href="/WebResource.axd?d=iC4Q3hnnzmFTp7YCqAYyJWRLxXvVCu0imrwleh5pLZzSjMz5ffNwRIAfGpCdNN-j48DCo-EXF8tOqbycGLUPiCh0DedzEXS6K2hGXpTKYLo1&t=634669012909338819" rel="stylesheet" /></head>
<body>
<form method="post" action="WebForm3.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTUwOTk1NDc4OQ9kFgICAw9kFgICAQ8PFgQeCENzc0NsYXNzBQN0YjMeBF8hU0ICAmRkZM0gkOkAJP19yu9J5cPNE0DYm4dU6+TVVJKVMS5k39uC" />
</div>
|
|
|
|
|
Fixed
Right click resource file.In the Properties dialog box, locate the Build Action property. By default, this property is set to Content. Click the property and change the Build Action property to Embedded Resource.
|
|
|
|
|
Hi guys,
A customer just reproted a problem that's quite strange. They are using an ASP.NET application with a ReportViewer 9.0 control.
The report doesn't render at all (totally blank, although the toolbar is there) but if I export the result the PDF comes out perfectly. If I run it on my computer (and many others), it works fine.
The user is running WinXP with IE 8. [UPDATE: Specifically IE 8.0.6001.18702 update versión 0]
I googled it and found this[^] where several users report the same problem, but no solution is proposed.
Have any of you ran into this?
Thanks!!
modified 8-Mar-12 12:38pm.
|
|
|
|
|
I am writing a custom control - Calendar textbox. In the code of the custom control i have added a attribute by the following code:
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
base.AddAttributesToRender(writer);
writer.AddAttribute("isDateControl", "true");
writer.AddAttribute("ShowCalendar", "true");
writer.AddAttribute("maxlength", "10");
}
Here I have added the attribute named ShowCalendar.
I have one js where i am calling this above property values as shown below:
base.OnPreRender(e);
System.Web.UI.ClientScriptManager cs = this.Page.ClientScript;
cs.RegisterClientScriptResource(typeof(WebDate), "WebControls.WebDate.WebDate.js");
Inside JS..I put the alert box to get the value of the property named
"ShowCalendar"
Shown below :
if (obj.getAttribute("ShowCalendar") == "false")
{
alert(obj.getAttribute("_IsShowCalendar"));
}
else
{
alert(obj.getAttribute("_IsShowCalendar"));
}
Till now no issues ..all fine .. I can see the value of "ShowCalendar" attribute from JS alert box, But when i change the value to true to false or vice versa in the html tag shown below:
<tsg:WebDate ShowCalendar="false" runat="server"> </tsg:WebDate>
Value is not getting toggled from the JavaScript alert box.
Could you please tell me what the issue , why the value is not toggling?
posted 6 seconds ago in Software Development | Clarify my question
modified 9-Mar-12 0:39am.
|
|
|
|
|
Format your code using the code blocks.
Have you posted all the relevant code? I don't see any code that actually toggles your property.
|
|
|
|
|
Toggle i meant when i manually change the value ShowCalendar to True from False and vice versa
|
|
|
|