|
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.
|
|
|
|
|
You can try to do this from an ActiveX control. I would think that the only (legit) reason to do this is for some kind of security. You might want to use a username/password combination instead. Then allow a single user per username.
|
|
|
|
|
I want to restrict the application to specific computers.
With a username and password the user can use it anywhere !?
|
|
|
|
|
Why not get their IP addresses? You may need to create a range of valid IP addresses from the host providers for dynamic IPs. If someone logs in with their username/password, you validate that they are using a valid IP address. It won't completely fix your issue, but it may minimize the visiblilty.
|
|
|
|
|
I have this 'little' problem and can't find the correct answer. The situation is:
I have a asp.net form with 2 buttons (update and delete). When i press the update-button, i'm calling a javascript-function in my aspx wich presents a confirmationbox. After pressing 'OK' i do a doc.submit wich returns to my server-code. I check if it's a postback and want to know wich button (update or delete) i pressed. Now that's exactly the problem, i can't. When i return to the server-side i don't know wich button started the action so i don't know if i ought to update or to delete. I read something about Request.Params("__EVENTTARGET") but can't get this to work. Please help me out, either clean of with a dirty workaround.
Mark Mestrom
Webdeveloper at qualcomm
|
|
|
|
|
In java script function set click value in session variable or in cookies and then check on post back.
after every check clean the session or cookies for next time check.
according to your logic.
Parwej Ahamad
|
|
|
|
|
Hi,
I have 3 tables: table1, table2 and table3.
Table 1 (table1ID, Name1)
Table 2 (table2ID, table1ID, Name2)
Table 3 (table3ID, table2ID, Name3)
I have 2 DropDownLists: ddltable1SEARCH and ddltable2SEARCH.
They are both databound with the fields table1.Name1 and table2.Name2 respectively.
I also have a Datagrid: table3grid.
It is databound with the field table3.Name3.
NOTE: Please keep in mind the table relationships. My point is:
I CANNOT directly perform a search using the first dropdown. DropDown2 relies on DropDown1. When DropDown1 changes, DropDown2 changes to display available entries. THEN, the search is directly done by using DropDown2 for the Datagrid.
I have already created the view for the tables.
Therefore, I would like to know which of the following VB statements is syntatically correct when I am passing the search values from the DropDowns to a SubRoutine:
obj.SearchSubRoutine(Me.ddltable2SEARCH.SelectedValue)
OR
obj.SearchSubRoutine(Me.ddltable1SEARCH.SelectedValue And Me.ddltable2SEARCH.SelectedValue)
|
|
|
|