|
To use a button as the default button for a textbox or group or textboxes, get all the textboxes inside a panel and set the defaultbutton of the panel to the button you need as default
Alexei Rodriguez
|
|
|
|
|
Thanks Alexei for the TextBox tip. But how do I send the focus to the TextBox? Why the Focus() method doesn't work?
Regards
Ekjon
|
|
|
|
|
Set the defaultfocus of the form to the TextBox you want to receive focus
Form.DefaultFocus = "TextBoxName"
If you always want to set the focus to the same control, you can set this property during design time
Alexei Rodriguez
|
|
|
|
|
Hi,
I tried both Page.SetFocus(..) and Form.DefaultFocus = ..
They work fine, the problem is: I have a LinkButton that shows and hides the panel. The focus works if the panel is initially visible - then if the link is clicked to hide it, the focus doesn't come back when the panel is visible again.
On the other hand, if the panel is not initially visible - then the focus never works. Here's my code, the first one in the Page Load:
<br />
if (Page.IsPostBack)<br />
{<br />
if (pnlSearch.Visible == true)<br />
{<br />
Page.SetFocus(txtSearch);<br />
}<br />
}<br />
protected void lnkSearch_Click(object sender, EventArgs e)<br />
{<br />
pnlSearch.Visible = !pnlSearch.Visible;<br />
if (pnlSearch.Visible == true)<br />
{<br />
Page.SetFocus(txtSearch); <br />
}<br />
}
Part of the problem could be - I am using AJAX's UpdatePanel.
I am embarrassed to ask these trivial questions.
Ekjon
|
|
|
|
|
After creating the following menu I would like menuitem2 to be a sub menu of menuitem1. As the code is now both menu items are at the same level. How do I make menuitem2 a sub menu of menuitem1?
Dim menuitem1 As New MenuItem("Main topic")
Dim menuitem2 As New MenuItem(Sub topic")
Me.Menu1.Items.AddAt(0, menuitem1)
Me.Menu1.Items.AddAt(1, menuitem2)
|
|
|
|
|
Hi,
Do like this:
<br />
Dim menuitem1 As New MenuItem("Main topic")<br />
Dim menuitem2 As New MenuItem(Sub topic")<br />
<br />
menuitem1.ChildItems.Add(menuitem2)<br />
Me.Menu1.Items.AddAt(0, menuitem1)<br />
<br />
|
|
|
|
|
|
I am working on a project where I need to make a personality profiling application. Are there any examples out there that I can benefit from?
Like I need to ask several questions and somehow come up with a personality profile very similar to things seen on dating websites etc.
Also if there are any 3rd party components for personality profile then I can try to sell it to my boss (not sure if he will buy into that) it doesn’t hurt to try
Thanks.
|
|
|
|
|
Taurian110 wrote: Also if there are any 3rd party components for personality profile then I can try to sell it to my boss (not sure if he will buy into that) it doesn’t hurt to tr
Avoid posting official problems
Is Google working at your side ?
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Yes of course I googled it Haven't had any luck so far with .net components or examples, maybe I am not using the right keywords to search for it, who knows.
To me it’s more like a task for a Psychology student to come up with questions and answers and some formula to give a personality profile, its just funny to me that I am asked to do it lol.
But you would think it would be pretty trivial to have examples for stuff like that since its so common in community type websites.
|
|
|
|
|
Hi,
Due to various limitation i need to be able to change the format of dates in a SQl2005 db from DD/MM/YYYY to YYYY/MM/DD. Ideally this should be a stored proceedure.
Any help would as always be very greatfully received.
Thanks in advance.
Phill
|
|
|
|
|
Are you talking about updating the date format the way it is stored in the database? Or when you are retrieving it?
Also what is the data type of your date column is it varchar or DateTime?
If you just want to change the date format when retrieving the data then something like this will work:
SELECT
Convert(varchar, DATEPART(yyyy, UploadDate)) + '/' +
Convert(varchar, DATEPART(mm, UploadDate)) + '/' +
Convert(varchar, DATEPART(dd, UploadDate)) as MyNewFormat
FROM
dbo.[MytableName]
*Change the MytableName to your table and UploadeDate to your column name
hth
|
|
|
|
|
select convert(varchar,columnname,111) from myTable
I Love T-SQL
|
|
|
|
|
Its throwing up an OleDbException:
'Undefined function 'Convert' in expression.'
Any ideas?
|
|
|
|
|
Are you using SQL Server database or MS Access database?
I Love T-SQL
|
|
|
|
|
SQL 2005
Although im trying to do the convert on when uploading an Excel sheet to SQL2005 using BulkCopy.
See below:
<code>protected void Page_Load(object sender, EventArgs e)
{
// Connection String to Excel Workbook
//string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=BLAH\qs_upload.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=BLAH\qs_upload.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
// Create Connection to Excel Workbook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
OleDbCommand command = new OleDbCommand("Select * FROM [quality_standard$]", connection);
//OleDbCommand command = new OleDbCommand("Select qs_Id, qs_Organisation, Convert(varchar,qs_Start,111), qs_End FROM [quality_standard$]", connection);
connection.Open();
// Create DbDataReader to Data Worksheet
using (OleDbDataReader dr = command.ExecuteReader())
{
// SQL Server Connection String
string sqlConnectionString = "REMOVED"
// Bulk Copy to SQL Server
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "tbl_QualityStandard";
bulkCopy.WriteToServer(dr);
}
}
}
}</code>
|
|
|
|
|
Hi,
I have an aspx page that contains a control1, which contains another control (I call it, control2). My control2 contains a div (chartdiv) inside other div (chart). My chartdiv displays a graphic (everything done by Javascript) and onclick of the graphic I want to display other page. For that I put my graphic div (which is, chartdiv) inside other div (which is, chart) that allows to me click and open a new page. But my chart is always aligned to right and its not 100% correctly sized. Here is my code that I was refering:
control2 code:
The chart will appear within this DIV. This text will be replaced by the chart.
code behind code:
string IframeSrc = _urlHelper.HandleRootOperator("~/frm_statistic.aspx") + "?pubId=" + _pubId;
chart.Attributes.Add("onclick", "callLinksPage('" + IframeSrc + "','" + "Detailed Statistics for:"+this.State.PublicationTitle + "','760','570');");
Can anyone tell me can't I click my grpahic and open a new page? Is my code works ? or Is there other way to do this.
Thanks.
|
|
|
|
|
It will be helpfull if you right click ur page and copy and paste the HTML so we can see how the page is being rendered.
|
|
|
|
|
Complete Traffic Statistic
|
function LoadChart()
{
//alert(DataLink)
var myChart = new FusionCharts(ChartLink, "myChartId", "198", "135", "0", "0");
myChart.setDataURL(escape(DataLink));
myChart.render("chartdiv");
}
function getTimeForURL()
{
var dt = new Date();
var strOutput = "";
strOutput = dt.getHours() + "_" + dt.getMinutes() + "_" + dt.getSeconds() + "_" + dt.getMilliseconds();
return strOutput;
}
The chart will appear within this DIV. This text will be replaced by the chart.
LoadChart()
|
|
|
|
|
|
|
I dont see the html tags i think its blocked by the editor. When you are posting HTML tags there is an option below the editor "Ignore HTML tags in this message (good for code snippets)" I think if you click that, it will allow you to post the HTML source code.
HTH
|
|
|
|
|
<code><tr>
<td class="tdCRF">
<div class="divStatistics">
<b> <table cellpadding="0" cellspacing="0" width="100%" class="tblStatistics" id="tblStatistics">
<tr>
<td align="left" colspan="2">
<a id="ctl00_RightColumn_WucCRF1_aDisplayStat" title="Detailed Statistic for: HyperNet Configuration File Description" class="handPointer" onclick="callLinksPage('/doXtop/frm_statistic.aspx?pubId=4a095bf','Detailed Statistic for: HyperNet Configuration File Description','760','570');"><strong>
Complete Traffic Statistic</strong> </a>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width:100%">
<script type="text/javascript">
function LoadChart()
{
//alert(DataLink)
var myChart = new FusionCharts(ChartLink, "myChartId", "198", "135", "0", "0");
myChart.setDataURL(escape(DataLink));
myChart.render("chartdiv");
}
function getTimeForURL()
{
var dt = new Date();
var strOutput = "";
strOutput = dt.getHours() + "_" + dt.getMinutes() + "_" + dt.getSeconds() + "_" + dt.getMilliseconds();
return strOutput;
}
</script>
<div id="ctl00_RightColumn_WucCRF1_WucStatistics1_chart" class="handPointer" style="width:100%" onclick="callLinksPage('/doXtop/frm_statistic.aspx?pubId=4a095bf','Detailed Statistics for:HyperNet Configuration File Description','760','570');">
<div id="chartdiv">
The chart will appear within this DIV. This text will be replaced by the chart.
</div>
</div>
<script type="text/javascript">
LoadChart()
</script>
</td>
</tr>
</table>
</td>
</tr>
</table> </b>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table></code>
|
|
|
|
|
ok, so i'm messing around seeing what i can do with the different controls (i started doing ASP last monday ^_^) and i think i pretty much have the basics down. problem is, i can't find any way to pass an argument from a checkbox.
Default.aspx:
<code><asp:CheckBox runat="server"
ID="chkFirst" AutoPostBack="true"
OnCheckedChanged="Check_Controls(chkFirst.ID,lblFirstCheck.ID)" />
<asp:Label runat="server"
ID="lblFirstCheck"
Text=""></asp:Label>
</code>
Default.aspx.vb
<code>
Sub Check_Controls(ByVal sender As Object, ByVal e As String)
Dim tmpCheck As CheckBox = Page.FindControl(sender)
Dim tmpLabel As Label = Page.FindControl(e)
If tmpCheck.Checked = True Then
tmpLabel.Text = "Checked!"
Else
tmpLabel.Text = "Not checked :("
End If
End Sub
</code> |
|
If i call a separate sub and use it declare and pass the label.id and checkbox.id into Check_Controls then it works like a champ.
If i use the code as posted above, it generates the error: "'AddressOf' operand must be the name of a method (without parentheses)" for the line with OnCheckedChanged.
I made buttons that pass in this manner without any trouble using 'commandargument' but checkboxes don't seem to have an equivalent setup.
I've googled and googled and googled but haven't found any way to do this. The only thing close is a brief mention by someone that they used the "cssClass" attribute as a workaround but they didn't expand on exactly 'how' they did it.
Any help would be appreciated. ^_^
modified on Friday, April 25, 2008 12:20 PM
|
|
|
|
|
What are you exactly trying to do??
Am i missing something??
Sub Check_Controls(ByVal sender As Object, ByVal e As String)
If chkFirst.Checked = True Then
lblFirstCheck.Text = "Checked!"
Else
lblFirstCheck.Text = "Not checked "
End If
End Sub
the_0live wrote: i pretty much have the basics down
If this was your question
Im sorry to tell you, But you dont have any basics down
Alexei Rodriguez
|
|
|
|
|
like i said, i'm trying to pass a value similar to the 'commandargument' property of a button. for instance instead of just passing checked/not checked i'd like to be able to pass a separate variable/string:
with a button i can do this:
Sub Button_Controls(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
Dim tmpLabel As Label = Page.FindControl(e.CommandArgument)
If tmpLabel.Visible = True Then
tmpLabel.Visible = False
tmpLabel.Text = ""
Else
tmpLabel.Visible = True
tmpLabel.Text = "Now I have text!"
End If
End Sub
in a checkbox, i can only seem to pass whether or not the box was checked. not an actual value.
my goal is to have (like the working button example above) a single sub that can handle multiple checkboxes and their corresponding labels.
|
|
|
|
|
anyone? anything? is there maybe another site/forum i could take this question to?
|
|
|
|