且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从上传的文件中获取文本字段数据

更新时间:2023-02-08 17:34:48

您要问的是不可能的.根据这种模糊的描述,我们可以给出什么样的想法"?文件采用什么形式?为什么不能读取文件并进行解析?你困在哪里?你尝试了什么?

解析文件,查找数据并设置表单元素的值,对我来说似乎很简单.
What you''re asking is impossible. What sort of ''ideas'' can we give, based on this vague description ? What form does the file take ? Why can''t you read the file and parse it ? Where are you stuck ? What have you tried ?

Parse the file, find the data, and set the values of the form elements, seems simple to me.



您必须使用Jquery简化解决方案,请在下面尝试以下代码,
在您的注册页面中
Hi,
You have to use Jquery to make the solution simple,Try this code below,
in your registration page
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script type="text/javascript">
        function FireUploadEvent(val) {


(#%> ).click(); } < /script > < asp:fileupload id =" runat 服务器" onchange javascript:FireUploadEvent();" ">/ > < div =" < asp:button 运行 =" id UploadButton " 文本 上传" onclick UploadButton_Click" / > < /div >
("#<%= UploadButton.ClientID %>").click(); } </script> <asp:fileupload id="FileUploadControl" runat="server" onchange="javascript:FireUploadEvent();" /> <div style="visibility: hidden"> <asp:button runat="server" id="UploadButton" text="Upload" onclick="UploadButton_Click" /> </div>


UploadButton_Click事件处理程序中,您可以包括数据插入逻辑.
希望这能解决您的问题.


in UploadButton_Click event handler, you can include data insertion logics.
Hope this will address your issue.