|
i have the webuser control ,this user control added on the webform ,yes i added the default string in the item collection of the dropdownlist whn this control is rendered on the webform it not shows the item collection (--Select--).it only shows the Database items that is comming from the database.
how can i overcome this
|
|
|
|
|
OK Nabeel
i think our are using Databind method databind method does not show any static values i.e it clears and then add
do one thing instead of databind use Dropdownlist1.Items.Add method
and use dataset for retriving from database i think it will work now
|
|
|
|
|
how to retreive the value from dataset
and append the value to dropdownlist
|
|
|
|
|
thks alot to all ,my problem is solved.
|
|
|
|
|
hai nabeel
can u send me the code iam facing the same problem
with regards
ravi
|
|
|
|
|
if you have datset which contains the data from database then try this code
for (int index = 0; index < ds.Tables[0].Rows.Count; index++)
{
object[] array = ds.Tables[0].Rows[index].ItemArray;
string str = array.GetValue(0).ToString();
DropDownList1.Items.Add(str);
}
|
|
|
|
|
I am uploading the excel file in my current project.
The field with only alphabets and
the field with only numbers are beeing uploaded proprly
but the fields with alpha-numerics gives blank value while
uploading.
If anyone have any idia about this then
pls let me know
Regards
Chintan
|
|
|
|
|
Hi all,
My web form consists of some text boxes, and some drop down lists. I want to check whether a particular item in each drop down list is selected or not.So i make use of java script.I am using html button to submit the form.
html button's client side "onclick" i am using java script to accomplish the above task , and server side "onserverclick" to implement business logic.
Now the problem is server side event executed eventhow the client side script returns -1.
Somebody please help me.
Thanks in advance.
Regards,
sumanth
this is sumanth, completed m.c.a from india.
|
|
|
|
|
How exactly are you attaching the javascript to the button click?
Best Regards,
Apurva Kaushal
|
|
|
|
|
and the client side block is
function fun()
{
alert("hi");
return -1;
}
server side block is
private void Button1_ServerClick(object sender, System.EventArgs e)
{
Label1.Text="From Client Side";
}
Server side block is executing even though client block returns -1
this is sumanth, completed m.c.a from india.
|
|
|
|
|
Hi Everybody ,
Can anybody guide me , that how to add color picker into the Datagrid
or datarepeater?
Tanks in Advance,
Param
param
|
|
|
|
|
Hi! i m using a session variable Session["userId"] in my application varaible. i make check in page load event as ...
if (Session["userId"] == null)
{
// redirect to login page
}
else
{
//store it in a variable for further use in this page
userId = Session["userId"].ToString().Trim();
}
now i want know where i will store value of this session variable?
[1.] in static variable OR
[2.] in a hidden field
OR
[3.] use this session variable as it is, that is use directly after checking nullabilty.
now problem is using it as [3.] that for example if in a function half worked is done & at some point i have to use this session variable & suppose it become null then what will i do?
redirect it to login page?
for this problem there is two solution [1] 7 [2.].
now which option will good? [1], [2] or [3.]
help me.
samir
|
|
|
|
|
First let's clear up some confusion:
1. You can't use static variables to store user specific data, as a static variable is shared by all threads.
2. A hidden field is only useful if you want to send the value from one page to the next, as an alternative to relying on the session.
3. A session variable can not become null during the execution of a page. If it exists when the execution starts, it will exist when it finishes.
In your code you put the value in the variable userId, just use that variable. There is no reason to put it anywhere else during the execution of the page.
---
b { font-weight: normal; }
|
|
|
|
|
|
Write somthing in your question don't shy
|
|
|
|
|
Hi.
I have Excel file, which I'm trying to load into DataGrid. The problem I have is that in Excel file some columns have TEXT (like: OLYMPIA EXP) or NUMBER (like: 100084) as a value. Let's say columnt Vendor has the above values(OLYMPIA EXP and 100084).
My code doesn't throgh any errors but displays TEXT only missing NUMBER values. I cannot figure this one out.
HELP PLEASE.
Private Sub DB_Connect()
Try
DS = New System.Data.DataSet
MyAdpapter = New System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & ExcelFilePath & "; " & _
"Extended Properties=Excel 8.0")
MyCmdSelect = New System.Data.OleDb.OleDbCommand("SELECT * FROM [Sheet1$]", MyConnection)
MyConnection.Open()
MyAdpapter.SelectCommand = MyCmdSelect
MyAdpapter.Fill(DS, "[Sheet1$]")
' Dim DV As DataView = DS.Tables(0).DefaultView
'If Not sort = "" Then
'DV.Sort = sort & Session("ORDER").ToString()
'End If
DG.DataSource = DS.Tables(0).DefaultView
DG.DataBind()
btnImport.Visible = False
MyConnection.Close()
Catch ex As Exception
lblError.Text = ex.ToString()
lblError.Visible = True
End Try
End Sub
|
|
|
|
|
Hi all,
Anyone please tell me whether the whole page is posted back after an event in .net 2005 web pages ( eg: after dropdownlist selected index changed or button click) or is it like an ajax enabled component since code-behind file is now a partial class rather than a full class that inherits from the ASPX page. Please explain.
Thanks in advance.
Ali
|
|
|
|
|
The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class.
The postback still works the same, and the aspx page still inherits from the codebehind class (not the other way around).
---
b { font-weight: normal; }
|
|
|
|
|
Thanks guffa, i was a bit confused.
|
|
|
|
|
Hi Guffa
Guffa wrote: The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class.
Which auto generated code you are referring to here.Do you mean vb.net code. I'm also confused about these partial classes. Partial class allows private part of other class to be accessed.thats OK but asp.net page still derives from codebehind so isn't it difficult to digest? Pls elaborate.
Thanks
-- modified at 0:09 Wednesday 8th November, 2006
Don't Quit
|
|
|
|
|
A partial class is just a class that is split into separate parts.
public partial class A {
... some code
}
public partial class A {
... some more code
}
is the same as:
public class A {
... some code
... some more code
}
The auto generated code is the code that is automatically created to interface with the server controls in the page.
For example, if you have a Label named InfoLabel in the page, a reference is created for it:
public protected Label InfoLabel;
---
b { font-weight: normal; }
|
|
|
|
|
Hey Folks,
I have been having some difficulties implementing the ChangePassword control to use the ActiveDirectoryMemembershipProvider. Any help or incite that you can provide would be most appreciated! Thanks in advance.
From within our webapp, despite the strength of the password used, when the ChangePassword control calls ActiveDirectoryMemembershipProvider.ChangePassword() function, a MembershipProviderException is thrown with the following description:
"The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. (Exception from HRESULT: 0x800708C5)"
However, the password policy for AD users is set as follows:
1) Enforce password history = 0 passwords remembered
2) Maximum password age = 0
3) Minimum password age = 0 days
4) Minimum password length = 8 characters
5) Password must meet complexity requirements = disabled
6) Store passwords using reversible encryption = disabled
(The AD server was rebooted)
Here are the configuration of the membership provider in the web.config:
<membership defaultprovider="MyADMembershipProvider">
<providers>
<add connectionstringname="ADConnectionString"
="" connectionusername="dev\administrator" connectionpassword="Password!" enablesearchmethods="true" name="MyADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionprotection="Secure" enablepasswordreset="true" requiresquestionandanswer="true" requiresuniqueemail="false" maxinvalidpasswordattempts="1000" minrequiredpasswordlength="8" minrequirednonalphanumericcharacters="0" passwordstrengthregularexpression=".*" attributemapusername="sAMAccountName" attributemappasswordquestion="UserPasswordQuestion" attributemappasswordanswer="UserPasswordAnswer" attributemapfailedpasswordanswercount="UserFailedPasswordAnswerCount" attributemapfailedpasswordanswertime="UserFailedPasswordAnswerTime" attributemapfailedpasswordanswerlockouttime="UserFailedPasswordAnswerLockoutTime">
As you can tell from the password policy and the web.config, we have opened this wide up. The strange thing is that we are using the AD Membership provider and ChangePassword control right out-of-the-box, with literally no customization at all, so we are at a bit of a loss here.
Has anyone else successfully implemented this? Any thoughts?
╔╗
╠╣MSTERDAMM
║╚"Half our life is spent trying to find something to do with the time we have rushed through life trying to save." -- Will Rogers
╝
|
|
|
|
|
How can i achieve this?
I want to get the MAC Address of the user Network Card. What are my options?
Does IE have an function for this ?
Is it possible through scripting ?
Will it work through a ActiveX Control ?
Thanks in advanced
|
|
|
|
|
I doubt IE would have the necessary security priviledges - my guess would be an ActiveX would be the only way, unless the web server's variables can help?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
After some more research i did, i think it is the only way to go.
|
|
|
|